debugfs: remove return value of debugfs_create_bool()
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 18:45:19 +0000 (20:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 May 2021 18:59:03 +0000 (20:59 +0200)
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>
Documentation/filesystems/debugfs.rst
fs/debugfs/file.c
include/linux/debugfs.h

index 0f2292e..71b1fee 100644 (file)
@@ -120,8 +120,8 @@ and hexadecimal::
 
 Boolean values can be placed in debugfs with::
 
-    struct dentry *debugfs_create_bool(const char *name, umode_t mode,
-                                      struct dentry *parent, bool *value);
+    void debugfs_create_bool(const char *name, umode_t mode,
+                             struct dentry *parent, bool *value);
 
 A read on the resulting file will yield either Y (for non-zero values) or
 N, followed by a newline.  If written to, it will accept either upper- or
index 54f8273..d4ab31e 100644 (file)
@@ -846,20 +846,11 @@ static const struct file_operations fops_bool_wo = {
  * This function creates a file in debugfs with the given name that
  * contains the value of the variable @value.  If the @mode variable is so
  * set, it can be read from, and written to.
- *
- * This function will return a pointer to a dentry if it succeeds.  This
- * pointer must be passed to the debugfs_remove() function when the file is
- * to be removed (no automatic cleanup happens if your module is unloaded,
- * you are responsible here.)  If an error occurs, ERR_PTR(-ERROR) will be
- * returned.
- *
- * If debugfs is not enabled in the kernel, the value ERR_PTR(-ENODEV) will
- * be returned.
  */
-struct dentry *debugfs_create_bool(const char *name, umode_t mode,
-                                  struct dentry *parent, bool *value)
+void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent,
+                        bool *value)
 {
-       return debugfs_create_mode_unsafe(name, mode, parent, value, &fops_bool,
+       debugfs_create_mode_unsafe(name, mode, parent, value, &fops_bool,
                                   &fops_bool_ro, &fops_bool_wo);
 }
 EXPORT_SYMBOL_GPL(debugfs_create_bool);
index 1fdb434..5315080 100644 (file)
@@ -126,8 +126,8 @@ void debugfs_create_size_t(const char *name, umode_t mode,
                           struct dentry *parent, size_t *value);
 void debugfs_create_atomic_t(const char *name, umode_t mode,
                             struct dentry *parent, atomic_t *value);
-struct dentry *debugfs_create_bool(const char *name, umode_t mode,
-                                 struct dentry *parent, bool *value);
+void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent,
+                        bool *value);
 void debugfs_create_str(const char *name, umode_t mode,
                        struct dentry *parent, char **value);
 
@@ -295,12 +295,8 @@ static inline void debugfs_create_atomic_t(const char *name, umode_t mode,
                                           atomic_t *value)
 { }
 
-static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
-                                                struct dentry *parent,
-                                                bool *value)
-{
-       return ERR_PTR(-ENODEV);
-}
+static inline void debugfs_create_bool(const char *name, umode_t mode,
+                                      struct dentry *parent, bool *value) { }
 
 static inline void debugfs_create_str(const char *name, umode_t mode,
                                      struct dentry *parent,