linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0244/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 10:52 Baole Ni
  2016-08-10 13:02 ` Linus Walleij
  0 siblings, 1 reply; 4+ messages in thread
From: Baole Ni @ 2016-08-02 10:52 UTC (permalink / raw)
  To: linux-arm-kernel

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/i2c/busses/i2c-stu300.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c
index 460c134..8128e25 100644
--- a/drivers/i2c/busses/i2c-stu300.c
+++ b/drivers/i2c/busses/i2c-stu300.c
@@ -133,7 +133,7 @@ enum stu300_error {
 
 /* I2C clock speed, in Hz 0-400kHz*/
 static unsigned int scl_frequency = 100000;
-module_param(scl_frequency, uint,  0644);
+module_param(scl_frequency, uint,  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 /**
  * struct stu300_dev - the stu300 driver state holder
-- 
2.9.2

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

* [PATCH 0244/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 10:52 [PATCH 0244/1285] Replace numeric parameter like 0444 with macro Baole Ni
@ 2016-08-10 13:02 ` Linus Walleij
  2016-08-10 13:45   ` Arnd Bergmann
  0 siblings, 1 reply; 4+ messages in thread
From: Linus Walleij @ 2016-08-10 13:02 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 2, 2016 at 12:52 PM, Baole Ni <baolex.ni@intel.com> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I assume Wolfram will merge this.

Yours,
Linus Walleij

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

* [PATCH 0244/1285] Replace numeric parameter like 0444 with macro
  2016-08-10 13:02 ` Linus Walleij
@ 2016-08-10 13:45   ` Arnd Bergmann
  2016-08-10 13:58     ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2016-08-10 13:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday, August 10, 2016 3:02:05 PM CEST Linus Walleij wrote:
> On Tue, Aug 2, 2016 at 12:52 PM, Baole Ni <baolex.ni@intel.com> 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>
> 
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> 
> I assume Wolfram will merge this.

I assume not, see http://lwn.net/Articles/696227/

	Arnd

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

* [PATCH 0244/1285] Replace numeric parameter like 0444 with macro
  2016-08-10 13:45   ` Arnd Bergmann
@ 2016-08-10 13:58     ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-08-10 13:58 UTC (permalink / raw)
  To: linux-arm-kernel


> > I assume Wolfram will merge this.
> 
> I assume not, see http://lwn.net/Articles/696227/

Thanks for the pointer. I missed the discussion but came up with the
same conclusions: a) octals are easier to read and b) original author
should have asked if this change was feasible before posting 1285
patches :(

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160810/3b814757/attachment.sig>

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

end of thread, other threads:[~2016-08-10 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 10:52 [PATCH 0244/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-10 13:02 ` Linus Walleij
2016-08-10 13:45   ` Arnd Bergmann
2016-08-10 13:58     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).