x86: platform: no need to check return value of debugfs_create functions

When calling debugfs functions, there is no need to ever check the
return value.  The function can work or not, but the code logic should
never do something different based on this.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <x86@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Greg Kroah-Hartman
2019-01-22 15:35:41 +01:00
parent 5dd82ba9e2
commit 519e96ee11
4 changed files with 13 additions and 60 deletions

View File

@@ -35,7 +35,6 @@
#include <linux/types.h>
struct imr_device {
struct dentry *file;
bool init;
struct mutex lock;
int max_imr;
@@ -231,13 +230,11 @@ DEFINE_SHOW_ATTRIBUTE(imr_dbgfs_state);
* imr_debugfs_register - register debugfs hooks.
*
* @idev: pointer to imr_device structure.
* @return: 0 on success - errno on failure.
*/
static int imr_debugfs_register(struct imr_device *idev)
static void imr_debugfs_register(struct imr_device *idev)
{
idev->file = debugfs_create_file("imr_state", 0444, NULL, idev,
&imr_dbgfs_state_fops);
return PTR_ERR_OR_ZERO(idev->file);
debugfs_create_file("imr_state", 0444, NULL, idev,
&imr_dbgfs_state_fops);
}
/**
@@ -582,7 +579,6 @@ static const struct x86_cpu_id imr_ids[] __initconst = {
static int __init imr_init(void)
{
struct imr_device *idev = &imr_dev;
int ret;
if (!x86_match_cpu(imr_ids) || !iosf_mbi_available())
return -ENODEV;
@@ -592,9 +588,7 @@ static int __init imr_init(void)
idev->init = true;
mutex_init(&idev->lock);
ret = imr_debugfs_register(idev);
if (ret != 0)
pr_warn("debugfs register failed!\n");
imr_debugfs_register(idev);
imr_fixup_memmap(idev);
return 0;
}