mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] debugfs: remove return value of debugfs_create_bool()
Date: Mon, 24 May 2021 11:41:19 +0200	[thread overview]
Message-ID: <YKt0v2etlFzpvE9r@kroah.com> (raw)
In-Reply-To: <CAMuHMdW42UAWRPWe09=0c=pkNLwwswoQHEbSHyXEjsfF6UZJdw@mail.gmail.com>

On Mon, May 24, 2021 at 11:11:32AM +0200, Geert Uytterhoeven wrote:
> Hi Greg,
> 
> Thanks for your patch!
> 
> On Fri, May 21, 2021 at 10:28 PM Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> 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.

Because you just do not need it, like almost all other debugfs calls
now.

> > the future.
> >
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> > --- 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?

Because there is no return value.

> Are we no longer allowed to remove individual debugfs entries?

It's not something that is almost ever needed.

> Do we always have to remove the whole parent directory and all its
> contents together?

For 99% of all debugfs usages, yes, that is true.

If you really do need the file dentry, there is still a call to create
it, and you can always query debugfs for the dentry after it is created
if you need it later on.

thanks,

greg k-h

  reply	other threads:[~2021-05-24  9:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 18:45 Greg Kroah-Hartman
2021-05-24  9:11 ` Geert Uytterhoeven
2021-05-24  9:41   ` Greg Kroah-Hartman [this message]
2021-05-24  9:51     ` Geert Uytterhoeven
2021-05-24 10:18       ` Greg Kroah-Hartman
2021-05-24 11:44         ` Geert Uytterhoeven
2021-05-24 12:39           ` Greg Kroah-Hartman
2021-05-25  7:26             ` Geert Uytterhoeven
2021-05-25  7:48               ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YKt0v2etlFzpvE9r@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®