mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
1be4ec2456
commit
393b06383f
3 changed files with 9 additions and 22 deletions
|
@ -120,8 +120,8 @@ and hexadecimal::
|
||||||
|
|
||||||
Boolean values can be placed in debugfs with::
|
Boolean values can be placed in debugfs with::
|
||||||
|
|
||||||
struct dentry *debugfs_create_bool(const char *name, umode_t mode,
|
void debugfs_create_bool(const char *name, umode_t mode,
|
||||||
struct dentry *parent, bool *value);
|
struct dentry *parent, bool *value);
|
||||||
|
|
||||||
A read on the resulting file will yield either Y (for non-zero values) or
|
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
|
N, followed by a newline. If written to, it will accept either upper- or
|
||||||
|
|
|
@ -846,20 +846,11 @@ static const struct file_operations fops_bool_wo = {
|
||||||
* This function creates a file in debugfs with the given name that
|
* 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
|
* contains the value of the variable @value. If the @mode variable is so
|
||||||
* set, it can be read from, and written to.
|
* 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,
|
void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent,
|
||||||
struct dentry *parent, bool *value)
|
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);
|
&fops_bool_ro, &fops_bool_wo);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(debugfs_create_bool);
|
EXPORT_SYMBOL_GPL(debugfs_create_bool);
|
||||||
|
|
|
@ -126,8 +126,8 @@ void debugfs_create_size_t(const char *name, umode_t mode,
|
||||||
struct dentry *parent, size_t *value);
|
struct dentry *parent, size_t *value);
|
||||||
void debugfs_create_atomic_t(const char *name, umode_t mode,
|
void debugfs_create_atomic_t(const char *name, umode_t mode,
|
||||||
struct dentry *parent, atomic_t *value);
|
struct dentry *parent, atomic_t *value);
|
||||||
struct dentry *debugfs_create_bool(const char *name, umode_t mode,
|
void debugfs_create_bool(const char *name, umode_t mode, struct dentry *parent,
|
||||||
struct dentry *parent, bool *value);
|
bool *value);
|
||||||
void debugfs_create_str(const char *name, umode_t mode,
|
void debugfs_create_str(const char *name, umode_t mode,
|
||||||
struct dentry *parent, char **value);
|
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)
|
atomic_t *value)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
static inline struct dentry *debugfs_create_bool(const char *name, umode_t mode,
|
static inline void debugfs_create_bool(const char *name, umode_t mode,
|
||||||
struct dentry *parent,
|
struct dentry *parent, bool *value) { }
|
||||||
bool *value)
|
|
||||||
{
|
|
||||||
return ERR_PTR(-ENODEV);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void debugfs_create_str(const char *name, umode_t mode,
|
static inline void debugfs_create_str(const char *name, umode_t mode,
|
||||||
struct dentry *parent,
|
struct dentry *parent,
|
||||||
|
|
Loading…
Add table
Reference in a new issue