mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0829/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 11:50 Baole Ni
  2016-08-02 12:36 ` Juergen Gross
  2016-08-02 14:50 ` Larry Finger
  0 siblings, 2 replies; 3+ messages in thread
From: Baole Ni @ 2016-08-02 11:50 UTC (permalink / raw)
  To: konrad.wilk, boris.ostrovsky, david.vrabel, jgross, bhelgaas,
	m.chehab, pawel, m.szyprowski, kyungmin.park, k.kozlowski
  Cc: linux-pcmcia, linux-kernel, chuansheng.liu, baolex.ni

I find that the developers often just specified the numeric value
when calling a macro which is defined with a parameter for access permission.
As we know, these numeric value for access permission have had the corresponding macro,
and that using macro can improve the robustness and readability of the code,
thus, I suggest replacing the numeric parameter with the macro.

Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
Signed-off-by: Baole Ni <baolex.ni@intel.com>
---
 drivers/pcmcia/cistpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
index 55ef7d1..ac6f619 100644
--- a/drivers/pcmcia/cistpl.c
+++ b/drivers/pcmcia/cistpl.c
@@ -57,7 +57,7 @@ static const u_int exponent[] = {
 
 /* 16-bit CIS? */
 static int cis_width;
-module_param(cis_width, int, 0444);
+module_param(cis_width, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 void release_cis_mem(struct pcmcia_socket *s)
 {
-- 
2.9.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0829/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 11:50 [PATCH 0829/1285] Replace numeric parameter like 0444 with macro Baole Ni
@ 2016-08-02 12:36 ` Juergen Gross
  2016-08-02 14:50 ` Larry Finger
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2016-08-02 12:36 UTC (permalink / raw)
  To: Baole Ni; +Cc: linux-kernel

On 02/08/16 13:50, Baole Ni wrote:
> I find that the developers often just specified the numeric value
> when calling a macro which is defined with a parameter for access permission.
> As we know, these numeric value for access permission have had the corresponding macro,
> and that using macro can improve the robustness and readability of the code,
> thus, I suggest replacing the numeric parameter with the macro.
> 
> Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
> Signed-off-by: Baole Ni <baolex.ni@intel.com>

This is the worst series of lkml spam I've ever received!

1. Make something like this a series in one thread, not 1285 single
   threads! Add a cover letter.
2. Don't write one patch per source file, one per subsystem is enough.
   Maybe even better: make a tree-wide patch using Coccinelle.
3. Use better subjects. I want to see the subsystem the patch is
   modifying.
4. Use _correct_ maintainers. WTF do I have to do with pcmcia?


Juergen

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0829/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 11:50 [PATCH 0829/1285] Replace numeric parameter like 0444 with macro Baole Ni
  2016-08-02 12:36 ` Juergen Gross
@ 2016-08-02 14:50 ` Larry Finger
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Finger @ 2016-08-02 14:50 UTC (permalink / raw)
  To: Baole Ni, konrad.wilk, boris.ostrovsky, david.vrabel, jgross,
	bhelgaas, m.chehab, pawel, m.szyprowski, kyungmin.park,
	k.kozlowski
  Cc: chuansheng.liu, linux-pcmcia, linux-kernel

On 08/02/2016 06:50 AM, Baole Ni wrote:
> I find that the developers often just specified the numeric value
> when calling a macro which is defined with a parameter for access permission.
> As we know, these numeric value for access permission have had the corresponding macro,
> and that using macro can improve the robustness and readability of the code,
> thus, I suggest replacing the numeric parameter with the macro.
>
> Signed-off-by: Chuansheng Liu <chuansheng.liu@intel.com>
> Signed-off-by: Baole Ni <baolex.ni@intel.com>

I'm not sure how much these changes improve robustness and/or readability, but 
they cause no harm. For that reason, the changes in rtlwifi drivers is acked.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>

Larry

> ---
>  drivers/pcmcia/cistpl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pcmcia/cistpl.c b/drivers/pcmcia/cistpl.c
> index 55ef7d1..ac6f619 100644
> --- a/drivers/pcmcia/cistpl.c
> +++ b/drivers/pcmcia/cistpl.c
> @@ -57,7 +57,7 @@ static const u_int exponent[] = {
>
>  /* 16-bit CIS? */
>  static int cis_width;
> -module_param(cis_width, int, 0444);
> +module_param(cis_width, int, S_IRUSR | S_IRGRP | S_IROTH);
>
>  void release_cis_mem(struct pcmcia_socket *s)
>  {
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-02 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 11:50 [PATCH 0829/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-02 12:36 ` Juergen Gross
2016-08-02 14:50 ` Larry Finger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®