History

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.

Greg Kroah-Hartman committed 7 years ago

Commit ad262211 parent 313f5db3 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
@@ -74,8 +74,8 @@ created with any of: · 73 unmodified lines
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 void debugfs_create_u64(const char *name, umode_t mode,
78 struct dentry *parent, u64 *value);78 struct dentry *parent, u64 *value);
79 79
80These files support both reading and writing the given value; if a specific80These files support both reading and writing the given value; if a specific
81file should not be written to, simply set the mode bits accordingly. The81file should not be written to, simply set the mode bits accordingly. The
fs/debugfs/file.c+3−12
@@ -538,20 +538,11 @@ DEFINE_DEBUGFS_ATTRIBUTE(fops_u64_wo, NULL, debugfs_u64_set, "%llu\n"); · 537 unmodified lines
538 * This function creates a file in debugfs with the given name that538 * This function creates a file in debugfs with the given name that
539 * contains the value of the variable @value. If the @mode variable is so539 * contains the value of the variable @value. If the @mode variable is so
540 * set, it can be read from, and written to.540 * 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.
550 */541 */
551struct dentry *debugfs_create_u64(const char *name, umode_t mode,542void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
552 struct dentry *parent, u64 *value)543 u64 *value)
553{544{
554 return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u64,545 debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u64,
555 &fops_u64_ro, &fops_u64_wo);546 &fops_u64_ro, &fops_u64_wo);
556}547}
557EXPORT_SYMBOL_GPL(debugfs_create_u64);548EXPORT_SYMBOL_GPL(debugfs_create_u64);
include/linux/debugfs.h+4−8
@@ -103,8 +103,8 @@ void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent, · 102 unmodified lines
103 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,106void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent,
107 struct dentry *parent, u64 *value);107 u64 *value);
108struct dentry *debugfs_create_ulong(const char *name, umode_t mode,108struct dentry *debugfs_create_ulong(const char *name, umode_t mode,
109 struct dentry *parent, unsigned long *value);109 struct dentry *parent, unsigned long *value);
110struct dentry *debugfs_create_x8(const char *name, umode_t mode,110struct 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, · 146 unmodified lines
257 return ERR_PTR(-ENODEV);257 return ERR_PTR(-ENODEV);
258}258}
259 259
260static inline struct dentry *debugfs_create_u64(const char *name, umode_t mode,260static inline void debugfs_create_u64(const char *name, umode_t mode,
261 struct dentry *parent,261 struct dentry *parent, u64 *value) { }
262 u64 *value)
263{
264 return ERR_PTR(-ENODEV);
265}
266 262
267static inline struct dentry *debugfs_create_ulong(const char *name,263static inline struct dentry *debugfs_create_ulong(const char *name,
268 umode_t mode,264 umode_t mode,

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