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_bool()

No one checks the return value of debugfs_create_bool(), as it's not
needed, so make the return value void, so that no one tries to do so in
the future.

Link: https://lore.kernel.org/r/20210521184519.1356639-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+9 -22
+2 -2
Documentation/filesystems/debugfs.rst
··· 120 120 121 121 Boolean values can be placed in debugfs with:: 122 122 123 - struct dentry *debugfs_create_bool(const char *name, umode_t mode, 124 - struct dentry *parent, bool *value); 123 + void debugfs_create_bool(const char *name, umode_t mode, 124 + struct dentry *parent, bool *value); 125 125 126 126 A read on the resulting file will yield either Y (for non-zero values) or 127 127 N, followed by a newline. If written to, it will accept either upper- or
+3 -12
fs/debugfs/file.c
··· 846 846 * This function creates a file in debugfs with the given name that 847 847 * contains the value of the variable @value. If the @mode variable is so 848 848 * set, it can be read from, and written to. 849 - * 850 - * This function will return a pointer to a dentry if it succeeds. This 851 - * pointer must be passed to the debugfs_remove() function when the file is 852 - * to be removed (no automatic cleanup happens if your module is unloaded, 853 - * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be 854 - * returned. 855 - * 856 - * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will 857 - * be returned. 858 849 */ 859 - struct dentry *debugfs_create_bool(const char *name, umode_t mode, 860 - struct dentry *parent, bool *value) 850 + void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, 851 + bool *value) 861 852 { 862 - return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_bool, 853 + debugfs_create_mode_unsafe(name, mode, parent, value, &fops_bool, 863 854 &fops_bool_ro, &fops_bool_wo); 864 855 } 865 856 EXPORT_SYMBOL_GPL(debugfs_create_bool);
+4 -8
include/linux/debugfs.h
··· 126 126 struct dentry *parent, size_t *value); 127 127 void debugfs_create_atomic_t(const char *name, umode_t mode, 128 128 struct dentry *parent, atomic_t *value); 129 - struct dentry *debugfs_create_bool(const char *name, umode_t mode, 130 - struct dentry *parent, bool *value); 129 + void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent, 130 + bool *value); 131 131 void debugfs_create_str(const char *name, umode_t mode, 132 132 struct dentry *parent, char **value); 133 133 ··· 295 295 atomic_t *value) 296 296 { } 297 297 298 - static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode, 299 - struct dentry *parent, 300 - bool *value) 301 - { 302 - return ERR_PTR(-ENODEV); 303 - } 298 + static inline void debugfs_create_bool(const char *name, umode_t mode, 299 + struct dentry *parent, bool *value) { } 304 300 305 301 static inline void debugfs_create_str(const char *name, umode_t mode, 306 302 struct dentry *parent,