Skip to content

Commit ad26221

Browse files
committed
debugfs: remove return value of debugfs_create_u64()
No one checks the return value of debugfs_create_u64(), 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-3-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 313f5db commit ad26221

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
@@ -74,8 +74,8 @@ created with any of:
7474
struct dentry *parent, u16 *value);
7575
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
7676
struct dentry *parent, u32 *value);
77-
struct dentry *debugfs_create_u64(const char *name, umode_t mode,
78-
struct dentry *parent, u64 *value);
77+
void debugfs_create_u64(const char *name, umode_t mode,
78+
struct dentry *parent, u64 *value);
7979

8080
These files support both reading and writing the given value; if a specific
8181
file should not be written to, simply set the mode bits accordingly. The

‎fs/debugfs/file.c‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -538,20 +538,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u64_wo, NULL, debugfs_u64_set, "%llu\n");
538538
* This function creates a file in debugfs with the given name that
539539
* contains the value of the variable @value. If the @mode variable is so
540540
* set, it can be read from, and written to.
541-
*
542-
* This function will return a pointer to a dentry if it succeeds. This
543-
* pointer must be passed to the debugfs_remove() function when the file is
544-
* to be removed (no automatic cleanup happens if your module is unloaded,
545-
* you are responsible here.) If an error occurs, %ERR_PTR(-ERROR) will be
546-
* returned.
547-
*
548-
* If debugfs is not enabled in the kernel, the value %ERR_PTR(-ENODEV) will
549-
* be returned.
550541
*/
551-
struct dentry *debugfs_create_u64(const char *name, umode_t mode,
552-
struct dentry *parent, u64 *value)
542+
void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
543+
u64 *value)
553544
{
554-
return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u64,
545+
debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u64,
555546
&fops_u64_ro, &fops_u64_wo);
556547
}
557548
EXPORT_SYMBOL_GPL(debugfs_create_u64);

‎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_u16(const char *name, umode_t mode, struct dentry *parent,
103103
u16 *value);
104104
struct dentry *debugfs_create_u32(const char *name, umode_t mode,
105105
struct dentry *parent, u32 *value);
106-
struct dentry *debugfs_create_u64(const char *name, umode_t mode,
107-
struct dentry *parent, u64 *value);
106+
void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
107+
u64 *value);
108108
struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
109109
struct dentry *parent, unsigned long *value);
110110
struct dentry *debugfs_create_x8(const char *name, umode_t mode,
@@ -257,12 +257,8 @@ static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
257257
return ERR_PTR(-ENODEV);
258258
}
259259

260-
static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,
261-
struct dentry *parent,
262-
u64 *value)
263-
{
264-
return ERR_PTR(-ENODEV);
265-
}
260+
static inline void debugfs_create_u64(const char *name, umode_t mode,
261+
struct dentry *parent, u64 *value) { }
266262

267263
static inline struct dentry *debugfs_create_ulong(const char *name,
268264
umode_t mode,

0 commit comments

Comments
 (0)