Skip to content

Commit 313f5db

Browse files
committed
debugfs: remove return value of debugfs_create_u16()
No one checks the return value of debugfs_create_u16(), 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 <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/20191011132931.1186197-2-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9655ac4 commit 313f5db

3 files changed

Lines changed: 9 additions & 22 deletions

File tree

‎Documentation/filesystems/debugfs.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ created with any of:
7070

7171
void debugfs_create_u8(const char *name, umode_t mode,
7272
struct dentry *parent, u8 *value);
73-
struct dentry *debugfs_create_u16(const char *name, umode_t mode,
74-
struct dentry *parent, u16 *value);
73+
void debugfs_create_u16(const char *name, umode_t mode,
74+
struct dentry *parent, u16 *value);
7575
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
7676
struct dentry *parent, u32 *value);
7777
struct dentry *debugfs_create_u64(const char *name, umode_t mode,

‎fs/debugfs/file.c‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -456,20 +456,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u16_wo, NULL, debugfs_u16_set, "%llu\n");
456456
* This function creates a file in debugfs with the given name that
457457
* contains the value of the variable @value. If the @mode variable is so
458458
* set, it can be read from, and written to.
459-
*
460-
* This function will return a pointer to a dentry if it succeeds. This
461-
* pointer must be passed to the debugfs_remove() function when the file is
462-
* to be removed (no automatic cleanup happens if your module is unloaded,
463-
* you are responsible here.) If an error occurs, %ERR_PTR(-ERROR) will be
464-
* returned.
465-
*
466-
* If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will
467-
* be returned.
468459
*/
469-
struct dentry *debugfs_create_u16(const char *name, umode_t mode,
470-
struct dentry *parent, u16 *value)
460+
void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
461+
u16 *value)
471462
{
472-
return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u16,
463+
debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u16,
473464
&fops_u16_ro, &fops_u16_wo);
474465
}
475466
EXPORT_SYMBOL_GPL(debugfs_create_u16);

‎include/linux/debugfs.h‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
9999

100100
void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,
101101
u8 *value);
102-
struct dentry *debugfs_create_u16(const char *name, umode_t mode,
103-
struct dentry *parent, u16 *value);
102+
void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
103+
u16 *value);
104104
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
105105
struct dentry *parent, u32 *value);
106106
struct dentry *debugfs_create_u64(const char *name, umode_t mode,
@@ -247,12 +247,8 @@ static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentr
247247
static inline void debugfs_create_u8(const char *name, umode_t mode,
248248
struct dentry *parent, u8 *value) { }
249249

250-
static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,
251-
struct dentry *parent,
252-
u16 *value)
253-
{
254-
return ERR_PTR(-ENODEV);
255-
}
250+
static inline void debugfs_create_u16(const char *name, umode_t mode,
251+
struct dentry *parent, u16 *value) { }
256252

257253
static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
258254
struct dentry *parent,

0 commit comments

Comments
 (0)