History

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.

Greg Kroah-Hartman committed 7 years ago

Commit 313f5db1 parent 9655ac43 files · +9 −22Browse files

Unified · Split

3 files
  1. Documentation/filesystems/debugfs.txt +2 −2
  2. fs/debugfs/file.c +3 −12
  3. include/linux/debugfs.h +4 −8
Documentation/filesystems/debugfs.txt+2−2
@@ -70,8 +70,8 @@ created with any of: · 69 unmodified lines
70 70
71 void debugfs_create_u8(const char *name, umode_t mode,71 void debugfs_create_u8(const char *name, umode_t mode,
72 struct dentry *parent, u8 *value);72 struct dentry *parent, u8 *value);
73 struct dentry *debugfs_create_u16(const char *name, umode_t mode,73 void debugfs_create_u16(const char *name, umode_t mode,
74 struct dentry *parent, u16 *value);74 struct dentry *parent, u16 *value);
75 struct dentry *debugfs_create_u32(const char *name, umode_t mode,75 struct dentry *debugfs_create_u32(const char *name, umode_t mode,
76 struct dentry *parent, u32 *value);76 struct dentry *parent, u32 *value);
77 struct dentry *debugfs_create_u64(const char *name, umode_t mode,77 struct dentry *debugfs_create_u64(const char *name, umode_t mode,
fs/debugfs/file.c+3−12
@@ -456,20 +456,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u16_wo, NULL, debugfs_u16_set, "%llu\n"); · 455 unmodified lines
456 * This function creates a file in debugfs with the given name that456 * This function creates a file in debugfs with the given name that
457 * contains the value of the variable @value. If the @mode variable is so457 * contains the value of the variable @value. If the @mode variable is so
458 * set, it can be read from, and written to.458 * 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.
468 */459 */
469struct dentry *debugfs_create_u16(const char *name, umode_t mode,460void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
470 struct dentry *parent, u16 *value)461 u16 *value)
471{462{
472 return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u16,463 debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u16,
473 &fops_u16_ro, &fops_u16_wo);464 &fops_u16_ro, &fops_u16_wo);
474}465}
475EXPORT_SYMBOL_GPL(debugfs_create_u16);466EXPORT_SYMBOL_GPL(debugfs_create_u16);
include/linux/debugfs.h+4−8
@@ -99,8 +99,8 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, · 98 unmodified lines
99 99
100void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,100void debugfs_create_u8(const char *name, umode_t mode, struct dentry *parent,
101 u8 *value);101 u8 *value);
102struct dentry *debugfs_create_u16(const char *name, umode_t mode,102void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent,
103 struct dentry *parent, u16 *value);103 u16 *value);
104struct dentry *debugfs_create_u32(const char *name, umode_t mode,104struct dentry *debugfs_create_u32(const char *name, umode_t mode,
105 struct dentry *parent, u32 *value);105 struct dentry *parent, u32 *value);
106struct dentry *debugfs_create_u64(const char *name, umode_t mode,106struct 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 · 140 unmodified lines
247static inline void debugfs_create_u8(const char *name, umode_t mode,247static inline void debugfs_create_u8(const char *name, umode_t mode,
248 struct dentry *parent, u8 *value) { }248 struct dentry *parent, u8 *value) { }
249 249
250static inline struct dentry *debugfs_create_u16(const char *name, umode_t mode,250static inline void debugfs_create_u16(const char *name, umode_t mode,
251 struct dentry *parent,251 struct dentry *parent, u16 *value) { }
252 u16 *value)
253{
254 return ERR_PTR(-ENODEV);
255}
256 252
257static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,253static inline struct dentry *debugfs_create_u32(const char *name, umode_t mode,
258 struct dentry *parent,254 struct dentry *parent,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t