[PATCH v1 11/12] i2c: isch: Prefer to use octal permission

Andy Shevchenko posted 12 patches 2 months, 2 weeks ago
There is a newer version of this series
[PATCH v1 11/12] i2c: isch: Prefer to use octal permission
Posted by Andy Shevchenko 2 months, 2 weeks ago
Octal permissions are preferred over the symbolics ones
for readbility. This ceases warning message pointed by checkpatch.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/i2c/busses/i2c-isch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c
index 8fa48a346e12..a6aa28000568 100644
--- a/drivers/i2c/busses/i2c-isch.c
+++ b/drivers/i2c/busses/i2c-isch.c
@@ -49,7 +49,7 @@ struct sch_i2c {
 };
 
 static int backbone_speed = 33000; /* backbone speed in kHz */
-module_param(backbone_speed, int, S_IRUSR | S_IWUSR);
+module_param(backbone_speed, int, 0600);
 MODULE_PARM_DESC(backbone_speed, "Backbone speed in kHz, (default = 33000)");
 
 static inline u8 sch_io_rd8(struct sch_i2c *priv, unsigned int offset)
-- 
2.43.0.rc1.1336.g36b5255a03ac
Re: [PATCH v1 11/12] i2c: isch: Prefer to use octal permission
Posted by Jesper Juhl 2 months, 2 weeks ago
Personally I find this to be *less* readable, but maybe that's just me.

On Wed, 11 Sept 2024 at 17:51, Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Octal permissions are preferred over the symbolics ones
> for readbility. This ceases warning message pointed by checkpatch.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/i2c/busses/i2c-isch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-isch.c b/drivers/i2c/busses/i2c-isch.c
> index 8fa48a346e12..a6aa28000568 100644
> --- a/drivers/i2c/busses/i2c-isch.c
> +++ b/drivers/i2c/busses/i2c-isch.c
> @@ -49,7 +49,7 @@ struct sch_i2c {
>  };
>
>  static int backbone_speed = 33000; /* backbone speed in kHz */
> -module_param(backbone_speed, int, S_IRUSR | S_IWUSR);
> +module_param(backbone_speed, int, 0600);
>  MODULE_PARM_DESC(backbone_speed, "Backbone speed in kHz, (default = 33000)");
>
>  static inline u8 sch_io_rd8(struct sch_i2c *priv, unsigned int offset)
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
>
Re: [PATCH v1 11/12] i2c: isch: Prefer to use octal permission
Posted by Andy Shevchenko 2 months, 2 weeks ago
On Wed, Sep 11, 2024 at 05:53:44PM +0200, Jesper Juhl wrote:
> Personally I find this to be *less* readable, but maybe that's just me.

It's just you :-)

checkpatch should complain nowadays about non-octal permissions.
It is documented here Documentation/dev-tools/checkpatch.rst.
IIRC it's added after Linus' rant on them.

But nonetheless thanks for the review!

> On Wed, 11 Sept 2024 at 17:51, Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > Octal permissions are preferred over the symbolics ones
> > for readbility. This ceases warning message pointed by checkpatch.


-- 
With Best Regards,
Andy Shevchenko