Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20200416145448.GA1380878@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+9 -22
+2 -2
Documentation/filesystems/debugfs.rst
··· 79 79 struct dentry *parent, u8 *value); 80 80 void debugfs_create_u16(const char *name, umode_t mode, 81 81 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); 84 84 void debugfs_create_u64(const char *name, umode_t mode, 85 85 struct dentry *parent, u64 *value); 86 86
+3 -12
fs/debugfs/file.c
··· 506 506 * This function creates a file in debugfs with the given name that 507 507 * contains the value of the variable @value. If the @mode variable is so 508 508 * 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. 518 509 */ 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) 521 512 { 522 - return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u32, 513 + debugfs_create_mode_unsafe(name, mode, parent, value, &fops_u32, 523 514 &fops_u32_ro, &fops_u32_wo); 524 515 } 525 516 EXPORT_SYMBOL_GPL(debugfs_create_u32);
+4 -8
include/linux/debugfs.h
··· 103 103 u8 *value); 104 104 void debugfs_create_u16(const char *name, umode_t mode, struct dentry *parent, 105 105 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); 108 108 void debugfs_create_u64(const char *name, umode_t mode, struct dentry *parent, 109 109 u64 *value); 110 110 struct dentry *debugfs_create_ulong(const char *name, umode_t mode, ··· 250 250 static inline void debugfs_create_u16(const char *name, umode_t mode, 251 251 struct dentry *parent, u16 *value) { } 252 252 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) { } 259 255 260 256 static inline void debugfs_create_u64(const char *name, umode_t mode, 261 257 struct dentry *parent, u64 *value) { }