Re: [PATCH] debugfs: remove return value of debugfs_create_bool()

From: Geert Uytterhoeven
Date: Mon May 24 2021 - 05:11:47 EST


Hi Greg,

Thanks for your patch!

On Fri, May 21, 2021 at 10:28 PM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> 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

Please explain in the patch description why it is not needed.

> the future.
>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

> --- a/fs/debugfs/file.c
> +++ b/fs/debugfs/file.c
> @@ -836,20 +836,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,

Why isn't the above no longer true?
Are we no longer allowed to remove individual debugfs entries?
Do we always have to remove the whole parent directory and all its
contents together?

> - * you are responsible here.) If an error occurs, ERR_PTR(-ERROR) will be
> - * returned.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds