diff mbox series

pwm: core: Use octal permission

Message ID 20201118104730.4270-1-sohambiswas41@gmail.com
State Changes Requested
Headers show
Series pwm: core: Use octal permission | expand

Commit Message

Soham Biswas Nov. 18, 2020, 10:47 a.m. UTC
Fixes the following warning generated by checkpatch:

drivers/pwm/core.c:1341: WARNING: Symbolic permissions 'S_IRUGO' are
not preferred. Consider using octal permissions '0444'.

+debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
			    &pwm_debugfs_fops);

Signed-off-by: Soham Biswas <sohambiswas41@gmail.com>
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Uwe Kleine-König Nov. 18, 2020, 12:43 p.m. UTC | #1
[added "v2" to the subject, would have been better if you had already
done that. I don't know if/how this confuses tools like b4 and patchwork]

Hello,

On Wed, Nov 18, 2020 at 04:17:30PM +0530, Soham Biswas wrote:
> Fixes the following warning generated by checkpatch:
> 
> drivers/pwm/core.c:1341: WARNING: Symbolic permissions 'S_IRUGO' are
> not preferred. Consider using octal permissions '0444'.
> 
> +debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
> 			    &pwm_debugfs_fops);

something like: "Permission bits are easier readable in octal than with
using the symbolic names." in the commit log would be good for those of
us who missed why this was added to checkpatch.

Best regards
Uwe
Soham Biswas Nov. 18, 2020, 1:41 p.m. UTC | #2
Sure will do that. Sorry for the inconvenience, I am a bit new to the
process of emailing patches. Should I mark the next patch as v3?

On Wed, 18 Nov 2020 at 18:13, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
>
> [added "v2" to the subject, would have been better if you had already
> done that. I don't know if/how this confuses tools like b4 and patchwork]
>
> Hello,
>
> On Wed, Nov 18, 2020 at 04:17:30PM +0530, Soham Biswas wrote:
> > Fixes the following warning generated by checkpatch:
> >
> > drivers/pwm/core.c:1341: WARNING: Symbolic permissions 'S_IRUGO' are
> > not preferred. Consider using octal permissions '0444'.
> >
> > +debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
> >                           &pwm_debugfs_fops);
>
> something like: "Permission bits are easier readable in octal than with
> using the symbolic names." in the commit log would be good for those of
> us who missed why this was added to checkpatch.
>
> Best regards
> Uwe
>
>
> --
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Uwe Kleine-König Nov. 18, 2020, 1:48 p.m. UTC | #3
On Wed, Nov 18, 2020 at 07:11:35PM +0530, Soham Biswas wrote:
> Sure will do that. Sorry for the inconvenience, I am a bit new to the
> process of emailing patches. Should I mark the next patch as v3?

Yes, just pass -v3 to git-format-patch or git-send-email.

Best regards
Uwe
Lee Jones Nov. 18, 2020, 1:49 p.m. UTC | #4
On Wed, 18 Nov 2020, Soham Biswas wrote:

> Sure will do that. Sorry for the inconvenience, I am a bit new to the
> process of emailing patches. Should I mark the next patch as v3?

Make sure the text you are quoting does above your reply.

This is called top-posting and is frowned upon.

Yes, please bump the version number - it will make the tooling happy.

> On Wed, 18 Nov 2020 at 18:13, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
> >
> > [added "v2" to the subject, would have been better if you had already
> > done that. I don't know if/how this confuses tools like b4 and patchwork]
> >
> > Hello,
> >
> > On Wed, Nov 18, 2020 at 04:17:30PM +0530, Soham Biswas wrote:
> > > Fixes the following warning generated by checkpatch:
> > >
> > > drivers/pwm/core.c:1341: WARNING: Symbolic permissions 'S_IRUGO' are
> > > not preferred. Consider using octal permissions '0444'.
> > >
> > > +debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
> > >                           &pwm_debugfs_fops);
> >
> > something like: "Permission bits are easier readable in octal than with
> > using the symbolic names." in the commit log would be good for those of
> > us who missed why this was added to checkpatch.
> >
> > Best regards
> > Uwe
> >
> >
diff mbox series

Patch

diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 1f16f5365d3c..a8eff4b3ee36 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -1338,7 +1338,7 @@  DEFINE_SEQ_ATTRIBUTE(pwm_debugfs);
 
 static int __init pwm_debugfs_init(void)
 {
-	debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,
+	debugfs_create_file("pwm", S_IFREG | 0444, NULL, NULL,
 			    &pwm_debugfs_fops);
 
 	return 0;