EDAC: Make edac_debugfs_create_x*() return void [Linux 5.3]

This Linux kernel change "EDAC: Make edac_debugfs_create_x*() return void" is included in the Linux 5.3 release. This change is authored by Greg Kroah-Hartman <gregkh [at] linuxfoundation.org> on Tue Jun 11 19:54:33 2019 +0200. The commit for this change in Linux stable tree is 40d7962 (patch).

EDAC: Make edac_debugfs_create_x*() return void

The return values of edac_debugfs_create_x16() and
edac_debugfs_create_x8() are never checked (as they don't need to be),
so no need to have them return anything, just make the functions return
void instead.

This is done with the goal of being able to change the debugfs_create_x*
functions to also not return a value.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: James Morse <james.morse@arm.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Link: https://lkml.kernel.org/r/20190611175433.GA5108@kroah.com

There are 30 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/edac/debugfs.c     | 12 ++++++------
 drivers/edac/edac_module.h | 18 ++++++++----------
 2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/drivers/edac/debugfs.c b/drivers/edac/debugfs.c
index 6b8e484..1f94359 100644
--- a/drivers/edac/debugfs.c
+++ b/drivers/edac/debugfs.c
@@ -118,23 +118,23 @@ struct dentry *
 EXPORT_SYMBOL_GPL(edac_debugfs_create_file);

 /* Wrapper for debugfs_create_x8() */
-struct dentry *edac_debugfs_create_x8(const char *name, umode_t mode,
-                      struct dentry *parent, u8 *value)
+void edac_debugfs_create_x8(const char *name, umode_t mode,
+               struct dentry *parent, u8 *value)
 {
    if (!parent)
        parent = edac_debugfs;

-   return debugfs_create_x8(name, mode, parent, value);
+   debugfs_create_x8(name, mode, parent, value);
 }
 EXPORT_SYMBOL_GPL(edac_debugfs_create_x8);

 /* Wrapper for debugfs_create_x16() */
-struct dentry *edac_debugfs_create_x16(const char *name, umode_t mode,
-                      struct dentry *parent, u16 *value)
+void edac_debugfs_create_x16(const char *name, umode_t mode,
+                struct dentry *parent, u16 *value)
 {
    if (!parent)
        parent = edac_debugfs;

-   return debugfs_create_x16(name, mode, parent, value);
+   debugfs_create_x16(name, mode, parent, value);
 }
 EXPORT_SYMBOL_GPL(edac_debugfs_create_x16);
diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h
index dd7d0b5..bc4b806d 100644
--- a/drivers/edac/edac_module.h
+++ b/drivers/edac/edac_module.h
@@ -78,10 +78,10 @@ struct dentry *
 struct dentry *
 edac_debugfs_create_file(const char *name, umode_t mode, struct dentry *parent,
             void *data, const struct file_operations *fops);
-struct dentry *
-edac_debugfs_create_x8(const char *name, umode_t mode, struct dentry *parent, u8 *value);
-struct dentry *
-edac_debugfs_create_x16(const char *name, umode_t mode, struct dentry *parent, u16 *value);
+void edac_debugfs_create_x8(const char *name, umode_t mode,
+               struct dentry *parent, u8 *value);
+void edac_debugfs_create_x16(const char *name, umode_t mode,
+                struct dentry *parent, u16 *value);
 #else
 static inline void edac_debugfs_init(void)                 { }
 static inline void edac_debugfs_exit(void)                 { }
@@ -92,12 +92,10 @@ static inline void edac_create_debugfs_nodes(struct mem_ctl_info *mci)      { }
 static inline struct dentry *
 edac_debugfs_create_file(const char *name, umode_t mode, struct dentry *parent,
             void *data, const struct file_operations *fops)    { return NULL; }
-static inline struct dentry *
-edac_debugfs_create_x8(const char *name, umode_t mode,
-              struct dentry *parent, u8 *value)            { return NULL; }
-static inline struct dentry *
-edac_debugfs_create_x16(const char *name, umode_t mode,
-              struct dentry *parent, u16 *value)           { return NULL; }
+static inline void edac_debugfs_create_x8(const char *name, umode_t mode,
+                     struct dentry *parent, u8 *value) { }
+static inline void edac_debugfs_create_x16(const char *name, umode_t mode,
+                      struct dentry *parent, u16 *value)   { }
 #endif

 /*

Leave a Reply

Your email address will not be published. Required fields are marked *