Skip to contentSkip to conversation

pwm: core: Use octal permission

PATCH In review Soham Biswas 5 participants 25 messages Nov 17, 2020 – Nov 18, 2020 PWM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pwm: core: Use octal permission

Fixed Warning.
Replaced symbolic permission 'S_IRUGO' with octal permission '0444'.

---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
Signature · 1 line
2.29.2
#1 lore raw
Quoted 1 line · Soham Biswas

Fixed Warning.

Which warning does this fix?

Quoted 1 line

Replaced symbolic permission 'S_IRUGO' with octal permission '0444'.

This is semantically equivalent.

Not sure what and/or how this fixes anything.

Quoted 18 lines
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw

This fixes the following warning:

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

generated by the following script:

./scripts/checkpatch.pl --file --terse drivers/pwm/core.c

Quoted 37 lines · Lee Jones
Quoted 1 line · Soham Biswas

Fixed Warning.

Which warning does this fix?

Quoted 1 line

Replaced symbolic permission 'S_IRUGO' with octal permission '0444'.

This is semantically equivalent.

Not sure what and/or how this fixes anything.

Quoted 10 lines
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +0 -0
index 1f16f5365d3c..a8eff4b3ee36 100644

drivers/pwm/core.c DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); · line 1344

Quoted 8 lines
drivers/pwm/core.c +1 -1
@@ -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;

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services

Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw
In reply to Lee Jones

This fixes the following warning:

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

generated by the following script:

./scripts/checkpatch.pl --file --terse drivers/pwm/core.c

Quoted 37 lines · Lee Jones
Quoted 1 line · Soham Biswas

Fixed Warning.

Which warning does this fix?

Quoted 1 line

Replaced symbolic permission 'S_IRUGO' with octal permission '0444'.

This is semantically equivalent.

Not sure what and/or how this fixes anything.

Quoted 10 lines
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +0 -0
index 1f16f5365d3c..a8eff4b3ee36 100644

drivers/pwm/core.c DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); · line 1344

Quoted 8 lines
drivers/pwm/core.c +1 -1
@@ -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;

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services

Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw
Quoted 8 lines · Soham Biswas

This fixes the following warning:

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

generated by the following script:

./scripts/checkpatch.pl --file --terse drivers/pwm/core.c

Oh, it's a checkpatch.pl thing.

You should definitely quote the warning and describe where it came from in the commit log.

Not entirely sure what that warning is the result of. Probably as they're sightly harder to read and easier to get wrong. Still, I'll let Thierry decide whether the patch itself is suitable for inclusion into the PWM core.

Quoted 33 lines · Lee Jones
Quoted 32 lines · Soham Biswas
Quoted 2 lines

Fixed Warning.

Which warning does this fix?

Quoted 1 line

Replaced symbolic permission 'S_IRUGO' with octal permission '0444'.

This is semantically equivalent.

Not sure what and/or how this fixes anything.

Quoted 18 lines
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw
Quoted 46 lines · Lee Jones
Quoted 8 lines · Soham Biswas

This fixes the following warning:

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

generated by the following script:

./scripts/checkpatch.pl --file --terse drivers/pwm/core.c

Oh, it's a checkpatch.pl thing.

You should definitely quote the warning and describe where it came from in the commit log.

Not entirely sure what that warning is the result of. Probably as they're sightly harder to read and easier to get wrong. Still, I'll let Thierry decide whether the patch itself is suitable for inclusion into the PWM core.

Quoted 25 lines · Lee Jones
Quoted 24 lines · Soham Biswas
Quoted 2 lines

Fixed Warning.

Which warning does this fix?

Quoted 1 line

Replaced symbolic permission 'S_IRUGO' with octal permission '0444'.

This is semantically equivalent.

Not sure what and/or how this fixes anything.

Quoted 11 lines
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +0 -0
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -1338,7 +1338,7 @@ DEFINE_SEQ_ATTRIBUTE(pwm_debugfs);
 
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

drivers/pwm/core.c DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); · line 1341

Quoted 4 lines
drivers/pwm/core.c +1 -1
 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,

Actually I'd prefer keeping the symbolic name because this is easier to grep for. So to convince me a better reason than "checkpatch says so" is needed.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#6 lore raw
Quoted 3 lines · Uwe Kleine-König

Actually I'd prefer keeping the symbolic name because this is easier to grep for. So to convince me a better reason than "checkpatch says so" is needed.

https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/
-------------------------------------------------------------------
From: Linus Torvalds <[email protected]>
Date: Tue, 2 Aug 2016 16:58:29 -0400

The symbolic names are good for the *other* bits (ie sticky bit, and the inode mode _type_ numbers etc), but for the permission bits, the symbolic names are just insane crap. Nobody sane should ever use them. Not in the kernel, not in user space.

Linus

#7 lore raw
Quoted 11 lines · Joe Perches
Quoted 3 lines · Uwe Kleine-König

Actually I'd prefer keeping the symbolic name because this is easier to grep for. So to convince me a better reason than "checkpatch says so" is needed.

https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/
-------------------------------------------------------------------
From: Linus Torvalds <[email protected]>
Date: Tue, 2 Aug 2016 16:58:29 -0400

Quoted 6 lines

The symbolic names are good for the *other* bits (ie sticky bit, and the inode mode _type_ numbers etc), but for the permission bits, the symbolic names are just insane crap. Nobody sane should ever use them. Not in the kernel, not in user space.

Linus

I was waiting for this!

I see your "checkpatch" filter is working well Joe. :)

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#8 lore raw
In reply to Joe Perches
Quoted 11 lines · Joe Perches
Quoted 3 lines · Uwe Kleine-König

Actually I'd prefer keeping the symbolic name because this is easier to grep for. So to convince me a better reason than "checkpatch says so" is needed.

https://lore.kernel.org/lkml/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com/
-------------------------------------------------------------------
From: Linus Torvalds <[email protected]>
Date: Tue, 2 Aug 2016 16:58:29 -0400

Quoted 6 lines

The symbolic names are good for the *other* bits (ie sticky bit, and the inode mode _type_ numbers etc), but for the permission bits, the symbolic names are just insane crap. Nobody sane should ever use them. Not in the kernel, not in user space.

Linus

OK, "Linus says so" is considerably stronger than "checkpatch says so". So if you respin the patch with a better commit log, that's fine for me.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#9 lore raw

PATCH 1/1 pwm: core: Use octal permission

In reply to Soham Biswas

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
Signature · 1 line
2.29.2
#10 lore raw

[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,

Quoted 7 lines · Soham Biswas

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

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#11 lore raw

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?

Quoted 26 lines · Uwe Kleine-König

[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,

Quoted 7 lines · Soham Biswas

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/ |

#12 lore raw
Quoted 2 lines · Soham Biswas

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

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#13 lore raw
In reply to Soham Biswas
Quoted 2 lines · Soham Biswas

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.

Quoted 25 lines
Quoted 23 lines · Uwe Kleine-König

[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,

Quoted 7 lines · Soham Biswas

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

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#14 lore raw

PATCH 1/1 pwm: core: Use octal permission

In reply to Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
Signature · 1 line
2.29.2
#15 lore raw
Quoted 30 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -2
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
--
Quoted 2 lines

2.29.2

I passed -v3 to git-send-email but it didn't work it seems.

#16 lore raw
Quoted 29 lines · Soham Biswas
Quoted 28 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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);
 
Quoted 6 lines
Quoted 4 lines
drivers/pwm/core.c +0 -1
        return 0;
--

2.29.2

I passed -v3 to git-send-email but it didn't work it seems.

It only works if you use it with a commit range I guess, i.e. when it calls git-format-patch itself.

Also I think if you call checkpatch on your own patch (e.g. using:

	git format-patch -v3 --stdout | scripts/checkpatch.pl

) it will tell you to break the long line in the commit log.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#17 lore raw
Quoted 35 lines · Uwe Kleine-König
Quoted 29 lines · Soham Biswas
Quoted 28 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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);
 
Quoted 4 lines

drivers/pwm/core.c DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); · line 1344

Quoted 2 lines
drivers/pwm/core.c +0 -0
        return 0;

I passed -v3 to git-send-email but it didn't work it seems.

Quoted 8 lines

It only works if you use it with a commit range I guess, i.e. when it calls git-format-patch itself.

Also I think if you call checkpatch on your own patch (e.g. using:

	git format-patch -v3 --stdout | scripts/checkpatch.pl

) it will tell you to break the long line in the commit log.

That's funny! Although you can safely ignore that one.

I find it's better to keep errors/warnings whole.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#18 lore raw
Quoted 42 lines · Lee Jones
Quoted 40 lines · Uwe Kleine-König
Quoted 29 lines · Soham Biswas
Quoted 28 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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);
 
Quoted 4 lines

drivers/pwm/core.c DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); · line 1344

Quoted 2 lines
drivers/pwm/core.c +0 -0
        return 0;

I passed -v3 to git-send-email but it didn't work it seems.

It only works if you use it with a commit range I guess, i.e. when it calls git-format-patch itself.

Also I think if you call checkpatch on your own patch (e.g. using:

Quoted 7 lines
Quoted 3 lines
	git format-patch -v3 --stdout | scripts/checkpatch.pl

) it will tell you to break the long line in the commit log.

That's funny! Although you can safely ignore that one.

I find it's better to keep errors/warnings whole.

Yes, so please don't ignore that warning for:

Permission bits are easier readable in octal than with using the symbolic names.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#19 lore raw
Quoted 54 lines · Uwe Kleine-König
Quoted 42 lines · Lee Jones
Quoted 40 lines · Uwe Kleine-König
Quoted 29 lines · Soham Biswas
Quoted 28 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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);
 
Quoted 4 lines

drivers/pwm/core.c DEFINE_SEQ_ATTRIBUTE(pwm_debugfs); · line 1344

Quoted 2 lines
drivers/pwm/core.c +0 -0
        return 0;

I passed -v3 to git-send-email but it didn't work it seems.

It only works if you use it with a commit range I guess, i.e. when it calls git-format-patch itself.

Also I think if you call checkpatch on your own patch (e.g. using:

Quoted 7 lines
Quoted 3 lines
    git format-patch -v3 --stdout | scripts/checkpatch.pl

) it will tell you to break the long line in the commit log.

That's funny! Although you can safely ignore that one.

I find it's better to keep errors/warnings whole.

Yes, so please don't ignore that warning for:

Quoted 8 lines

Permission bits are easier readable in octal than with using the symbolic names.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |

I did fix that warning and ran the checkpatch script on my patch and it said that there were no errors or style problems.

#20 lore raw

PATCH v3 1/1 pwm: core: Use octal permission

In reply to Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -1
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
Signature · 1 line
2.29.2
#21 lore raw
Quoted 31 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pwm/core.c +1 -2
index 1f16f5365d3c..a8eff4b3ee36 100644
@@ -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;
--
Quoted 2 lines

2.29.2

I passed the -v3 flag this time to the git format patch and fixed the long lines error. It changed the name of the patch file though xD

#22 lore raw
In reply to Soham Biswas
Quoted 8 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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'.

Quoted 7 lines

+debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,

                            &pwm_debugfs_fops);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks. Though I did unwrap the checkpatch warning message as Uwe suggested.

Thierry

#23 lore raw
Quoted 18 lines · Thierry Reding
Quoted 8 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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'.

Quoted 7 lines

+debugfs_create_file("pwm", S_IFREG | S_IRUGO, NULL, NULL,

                            &pwm_debugfs_fops);
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines

Applied, thanks. Though I did unwrap the checkpatch warning message as Uwe suggested.

Thierry

Thank You!

#24 lore raw
In reply to Thierry Reding
Quoted 12 lines · Thierry Reding
Quoted 11 lines · Soham Biswas

Permission bits are easier readable in octal than with using the symbolic names.

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);
Quoted 7 lines
Quoted 4 lines
---
 drivers/pwm/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks. Though I did unwrap the checkpatch warning message as Uwe suggested.

Then feel free to add my

Thanks
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |