Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1481268 > unrolled thread

[PATCH resend] staging: comedi: comedi_fops: coding style fixes

Started byMatias Mucciolo <mmucciolo@suteba.org.ar>
First post2016-09-12 15:20 +0200
Last post2016-09-12 20:10 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH resend] staging: comedi: comedi_fops: coding style fixes Matias Mucciolo <mmucciolo@suteba.org.ar> - 2016-09-12 15:20 +0200
    Re: [PATCH resend] staging: comedi: comedi_fops: coding style fixes Ian Abbott <abbotti@mev.co.uk> - 2016-09-12 18:00 +0200
      Re: [PATCH resend] staging: comedi: comedi_fops: coding style fixes Matias Mucciolo <mmucciolo@suteba.org.ar> - 2016-09-12 18:10 +0200
    Re: [PATCH resend] staging: comedi: comedi_fops: coding style fixes Ian Abbott <abbotti@mev.co.uk> - 2016-09-12 20:10 +0200

#1481268 — [PATCH resend] staging: comedi: comedi_fops: coding style fixes

FromMatias Mucciolo <mmucciolo@suteba.org.ar>
Date2016-09-12 15:20 +0200
Subject[PATCH resend] staging: comedi: comedi_fops: coding style fixes
Message-ID<sgzjr-3N9-9@gated-at.bofh.it>
From: Matias Mucciolo <mmucciolo@suteba.org.ar>

- Fixed coding style in comedi_fops.c Symbolic to octal permission.

Signed-off-by: Matias Mucciolo <mmucciolo@suteba.org.ar>
---
 drivers/staging/comedi/comedi_fops.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 1999eed..bf922ea 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -81,20 +81,20 @@ struct comedi_file {
 	(COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
 
 static int comedi_num_legacy_minors;
-module_param(comedi_num_legacy_minors, int, S_IRUGO);
+module_param(comedi_num_legacy_minors, int, 0444);
 MODULE_PARM_DESC(comedi_num_legacy_minors,
 		 "number of comedi minor devices to reserve for non-auto-configured devices (default 0)"
 		);
 
 unsigned int comedi_default_buf_size_kb = CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB;
-module_param(comedi_default_buf_size_kb, uint, S_IRUGO | S_IWUSR);
+module_param(comedi_default_buf_size_kb, uint, 0644);
 MODULE_PARM_DESC(comedi_default_buf_size_kb,
 		 "default asynchronous buffer size in KiB (default "
 		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB) ")");
 
 unsigned int comedi_default_buf_maxsize_kb
 	= CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB;
-module_param(comedi_default_buf_maxsize_kb, uint, S_IRUGO | S_IWUSR);
+module_param(comedi_default_buf_maxsize_kb, uint, 0644);
 MODULE_PARM_DESC(comedi_default_buf_maxsize_kb,
 		 "default maximum size of asynchronous buffer in KiB (default "
 		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB) ")");
-- 
2.1.4

[toc] | [next] | [standalone]


#1481513

FromIan Abbott <abbotti@mev.co.uk>
Date2016-09-12 18:00 +0200
Message-ID<sgBOh-5gk-15@gated-at.bofh.it>
In reply to#1481268
On 12/09/16 14:18, Matias Mucciolo wrote:
>
> From: Matias Mucciolo <mmucciolo@suteba.org.ar>
>
> - Fixed coding style in comedi_fops.c Symbolic to octal permission.
>
> Signed-off-by: Matias Mucciolo <mmucciolo@suteba.org.ar>
> ---
>  drivers/staging/comedi/comedi_fops.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index 1999eed..bf922ea 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -81,20 +81,20 @@ struct comedi_file {
>  	(COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
>
>  static int comedi_num_legacy_minors;
> -module_param(comedi_num_legacy_minors, int, S_IRUGO);
> +module_param(comedi_num_legacy_minors, int, 0444);
>  MODULE_PARM_DESC(comedi_num_legacy_minors,
>  		 "number of comedi minor devices to reserve for non-auto-configured devices (default 0)"
>  		);
>
>  unsigned int comedi_default_buf_size_kb = CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB;
> -module_param(comedi_default_buf_size_kb, uint, S_IRUGO | S_IWUSR);
> +module_param(comedi_default_buf_size_kb, uint, 0644);
>  MODULE_PARM_DESC(comedi_default_buf_size_kb,
>  		 "default asynchronous buffer size in KiB (default "
>  		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB) ")");
>
>  unsigned int comedi_default_buf_maxsize_kb
>  	= CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB;
> -module_param(comedi_default_buf_maxsize_kb, uint, S_IRUGO | S_IWUSR);
> +module_param(comedi_default_buf_maxsize_kb, uint, 0644);
>  MODULE_PARM_DESC(comedi_default_buf_maxsize_kb,
>  		 "default maximum size of asynchronous buffer in KiB (default "
>  		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB) ")");
>

In my review of the earlier patch, I said I was fine with the octal 
constants, but on reflection, I'm not sure it's worth changing them just 
for the hell of it.  We'd probably get a patch from someone else later 
to change it back to symbolic constants.  Is there an actual coding 
style issue, or is this just a personal preference?

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

[toc] | [prev] | [next] | [standalone]


#1481518

FromMatias Mucciolo <mmucciolo@suteba.org.ar>
Date2016-09-12 18:10 +0200
Message-ID<sgBXX-5zs-11@gated-at.bofh.it>
In reply to#1481513
Hi Ian

yes its a coding style issue(checkpatch.pl WARN)

and reference:
https://lwn.net/Articles/696229/

(sorry about the noise.)

-- 

Matias Mucciolo

Area de Infraestructura.
Piedras 737 C.A.B.A 
SUTEBA 

On Monday 12 September 2016 16:52:59 Ian Abbott wrote:
> On 12/09/16 14:18, Matias Mucciolo wrote:
> >
> > From: Matias Mucciolo <mmucciolo@suteba.org.ar>
> >
> > - Fixed coding style in comedi_fops.c Symbolic to octal permission.
> >
> > Signed-off-by: Matias Mucciolo <mmucciolo@suteba.org.ar>
> > ---
> >  drivers/staging/comedi/comedi_fops.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> > index 1999eed..bf922ea 100644
> > --- a/drivers/staging/comedi/comedi_fops.c
> > +++ b/drivers/staging/comedi/comedi_fops.c
> > @@ -81,20 +81,20 @@ struct comedi_file {
> >  	(COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
> >
> >  static int comedi_num_legacy_minors;
> > -module_param(comedi_num_legacy_minors, int, S_IRUGO);
> > +module_param(comedi_num_legacy_minors, int, 0444);
> >  MODULE_PARM_DESC(comedi_num_legacy_minors,
> >  		 "number of comedi minor devices to reserve for non-auto-configured devices (default 0)"
> >  		);
> >
> >  unsigned int comedi_default_buf_size_kb = CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB;
> > -module_param(comedi_default_buf_size_kb, uint, S_IRUGO | S_IWUSR);
> > +module_param(comedi_default_buf_size_kb, uint, 0644);
> >  MODULE_PARM_DESC(comedi_default_buf_size_kb,
> >  		 "default asynchronous buffer size in KiB (default "
> >  		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB) ")");
> >
> >  unsigned int comedi_default_buf_maxsize_kb
> >  	= CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB;
> > -module_param(comedi_default_buf_maxsize_kb, uint, S_IRUGO | S_IWUSR);
> > +module_param(comedi_default_buf_maxsize_kb, uint, 0644);
> >  MODULE_PARM_DESC(comedi_default_buf_maxsize_kb,
> >  		 "default maximum size of asynchronous buffer in KiB (default "
> >  		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB) ")");
> >
> 
> In my review of the earlier patch, I said I was fine with the octal 
> constants, but on reflection, I'm not sure it's worth changing them just 
> for the hell of it.  We'd probably get a patch from someone else later 
> to change it back to symbolic constants.  Is there an actual coding 
> style issue, or is this just a personal preference?
> 
> -- 
> -=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
> -=(                          Web: http://www.mev.co.uk/  )=-

[toc] | [prev] | [next] | [standalone]


#1481779

FromIan Abbott <abbotti@mev.co.uk>
Date2016-09-12 20:10 +0200
Message-ID<sgDQ5-6NR-3@gated-at.bofh.it>
In reply to#1481268
On 12/09/16 14:18, Matias Mucciolo wrote:
>
> From: Matias Mucciolo <mmucciolo@suteba.org.ar>
>

Those three lines are unnecessary, especially the initial blank line. 
I'm not sure whether Greg will ask you to fix it up.

> - Fixed coding style in comedi_fops.c Symbolic to octal permission.
>
> Signed-off-by: Matias Mucciolo <mmucciolo@suteba.org.ar>
> ---
>  drivers/staging/comedi/comedi_fops.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
> index 1999eed..bf922ea 100644
> --- a/drivers/staging/comedi/comedi_fops.c
> +++ b/drivers/staging/comedi/comedi_fops.c
> @@ -81,20 +81,20 @@ struct comedi_file {
>  	(COMEDI_NUM_MINORS - COMEDI_NUM_BOARD_MINORS)
>
>  static int comedi_num_legacy_minors;
> -module_param(comedi_num_legacy_minors, int, S_IRUGO);
> +module_param(comedi_num_legacy_minors, int, 0444);
>  MODULE_PARM_DESC(comedi_num_legacy_minors,
>  		 "number of comedi minor devices to reserve for non-auto-configured devices (default 0)"
>  		);
>
>  unsigned int comedi_default_buf_size_kb = CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB;
> -module_param(comedi_default_buf_size_kb, uint, S_IRUGO | S_IWUSR);
> +module_param(comedi_default_buf_size_kb, uint, 0644);
>  MODULE_PARM_DESC(comedi_default_buf_size_kb,
>  		 "default asynchronous buffer size in KiB (default "
>  		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_SIZE_KB) ")");
>
>  unsigned int comedi_default_buf_maxsize_kb
>  	= CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB;
> -module_param(comedi_default_buf_maxsize_kb, uint, S_IRUGO | S_IWUSR);
> +module_param(comedi_default_buf_maxsize_kb, uint, 0644);
>  MODULE_PARM_DESC(comedi_default_buf_maxsize_kb,
>  		 "default maximum size of asynchronous buffer in KiB (default "
>  		 __MODULE_STRING(CONFIG_COMEDI_DEFAULT_BUF_MAXSIZE_KB) ")");
>

It looks like the octal permissions have been blessed from above 
(Linus), so this is good.

Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web