Skip to content

Commit 2b07021

Browse files
committed
debugfs: remove return value of debugfs_create_u32()
No one checks the return value of debugfs_create_u32(), as it's not needed, so make the return value void, so that no one tries to do so in the future. Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 7396047 commit 2b07021

File tree

3 files changed

+9
-22
lines changed

3 files changed

+9
-22
lines changed

Documentation/filesystems/debugfs.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ created with any of::
7979
struct dentry *parent, u8 *value);
8080
void debugfs_create_u16(const char *name, umode_t mode,
8181
struct dentry *parent, u16 *value);
82-
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
83-
struct dentry *parent, u32 *value);
82+
void debugfs_create_u32(const char *name, umode_t mode,
83+
struct dentry *parent, u32 *value);
8484
void debugfs_create_u64(const char *name, umode_t mode,
8585
struct dentry *parent, u64 *value);
8686

fs/debugfs/file.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -506,20 +506,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u32_wo, NULL, debugfs_u32_set, "%llu\n");
506506
* This function creates a file in debugfs with the given name that
507507
* contains the value of the variable @value. If the @mode variable is so
508508
* set, it can be read from, and written to.
509-
*
510-
* This function will return a pointer to a dentry if it succeeds. This
511-
* pointer must be passed to the debugfs_remove() function when the file is
512-
* to be removed (no automatic cleanup happens if your module is unloaded,
513-
* you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be
514-
* returned.
515-
*
516-
* If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will
517-
* be returned.
518509
*/
519-
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
520-
struct dentry *parent, u32 *value)
510+
void debugfs_create_u32(const char *name, umode_t mode, struct dentry *parent,
511+
u32 *value)
521512
{
522-
return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u32,
513+
debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u32,
523514
&fops_u32_ro, &fops_u32_wo);
524515
}
525516
EXPORT_SYMBOL_GPL(debugfs_create_u32);

include/linux/debugfs.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,
103103
u8 *value);
104104
void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
105105
u16 *value);
106-
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
107-
struct dentry *parent, u32 *value);
106+
void debugfs_create_u32(const char *name, umode_t mode, struct dentry *parent,
107+
u32 *value);
108108
void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
109109
u64 *value);
110110
struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
@@ -250,12 +250,8 @@ static inline void debugfs_create_u8(const char *name, umode_t mode,
250250
static inline void debugfs_create_u16(const char *name, umode_t mode,
251251
struct dentry *parent, u16 *value) { }
252252

253-
static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
254-
struct dentry *parent,
255-
u32 *value)
256-
{
257-
return ERR_PTR(-ENODEV);
258-
}
253+
static inline void debugfs_create_u32(const char *name, umode_t mode,
254+
struct dentry *parent, u32 *value) { }
259255

260256
static inline void debugfs_create_u64(const char *name, umode_t mode,
261257
struct dentry *parent, u64 *value) { }

0 commit comments

Comments
 (0)