linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Drew Fustini <drew@beagleboard.org>
To: Joe Perches <joe@perches.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Tony Lindgren <tony@atomide.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Jason Kridner <jkridner@beagleboard.org>,
	Robert Nelson <robertcnelson@beagleboard.org>
Subject: Re: [PATCH v2 1/2] pinctrl: use to octal permissions for debugfs files
Date: Wed, 10 Feb 2021 13:21:15 -0800	[thread overview]
Message-ID: <20210210212115.GA216435@x1> (raw)
In-Reply-To: <ef9bc69ea67b70557265f117ce2a09f8019bb17d.camel@perches.com>

On Wed, Feb 10, 2021 at 04:36:00AM -0800, Joe Perches wrote:
> On Wed, 2021-02-10 at 12:18 +0200, Andy Shevchenko wrote:
> > On Wed, Feb 10, 2021 at 10:30 AM Joe Perches <joe@perches.com> wrote:
> > > On Tue, 2021-02-09 at 23:49 -0800, Drew Fustini wrote:
> > 
> > > > -     debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO,
> > > > +     debugfs_create_file("pinctrl-devices", 0400,
> > > >                           debugfs_root, NULL, &pinctrl_devices_fops);
> > > 
> > > NAK.  You've changed the permission levels.
> > 
> > NAK is usually given when the whole idea is broken. Here is not the
> > case and you may have helped to amend the patch.
> 
> NAK IMO just means the patch should not be applied, not that the
> concept is broken.
> 
> > ...
> > 
> > > And you have to keep the S_IFREG or'd along with the octal.
> > 
> > Perhaps time to read the code?
> > https://elixir.bootlin.com/linux/latest/source/fs/debugfs/inode.c#L387
> 
> Then the commit message is also broken.
> 
> > > checkpatch does this conversion using this command line:
> > > 
> > > $ ./scripts/checkpatch.pl -f --show-types --terse drivers/pinctrl/*.[ch] --types=SYMBOLIC_PERMS --fix-inplace
> > 
> > NAK! See above.
> 
> The command line above is for octal conversion of the symbolic permissions.
> 
> Any other conversion would be for a different purpose and that purpose and
> should be described in the commit message.
> 
> 

Thanks for review comments from all.

I will change from the incorrect 0400 to 0444.

As for S_IFREG, it does seem like leaving off S_IFREG is the most common
case when using octal permissions with debugfs_create_*():

$ git grep debugfs_create drivers/ |grep 0444 |grep -v S_IFREG | wc -l
302
$ git grep debugfs_create drivers/ |grep 0444 |grep S_IFREG | wc -l
9

As noted by Andy, this is okay as the S_IFREG flag is added to the mode
__debugfs_create_file() inside fs/debugfs/inode.c. I will note this in
the commit message.

Thank you,
Drew

  reply	other threads:[~2021-02-10 21:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-10  7:49 [PATCH v2 0/2] pinctrl: pinmux: Add pinmux-select debugfs file Drew Fustini
2021-02-10  7:49 ` [PATCH v2 1/2] pinctrl: use to octal permissions for debugfs files Drew Fustini
2021-02-10  8:30   ` Joe Perches
2021-02-10 10:18     ` Andy Shevchenko
2021-02-10 12:36       ` Joe Perches
2021-02-10 21:21         ` Drew Fustini [this message]
2021-02-10 23:12           ` Joe Perches
2021-02-10  8:31   ` Geert Uytterhoeven
2021-02-10 10:14     ` Andy Shevchenko
2021-02-10 10:16   ` Andy Shevchenko
2021-02-10  7:49 ` [PATCH v2 2/2] pinctrl: pinmux: Add pinmux-select debugfs file Drew Fustini
2021-02-10  8:35   ` Geert Uytterhoeven
2021-02-10  9:56   ` Andy Shevchenko
2021-02-10 17:31     ` Drew Fustini
2021-02-10 18:20   ` Dan Carpenter
2021-02-10 18:39     ` Geert Uytterhoeven
2021-02-10 19:05       ` Dan Carpenter
2021-02-10 19:14         ` Drew Fustini
2021-02-10 19:04     ` Drew Fustini
2021-02-10 20:33       ` Dan Carpenter

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=20210210212115.GA216435@x1 \
    --to=drew@beagleboard.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=jkridner@beagleboard.org \
    --cc=joe@perches.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=robertcnelson@beagleboard.org \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).