* [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: linus.walleij, wsa, linux, airlied, kgene, k.kozlowski,
dougthompson, bp
Cc: linux-kernel, dianders, baolex.ni, aduggan, linux-i2c,
chuansheng.liu, 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
* Re: [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: Baole Ni
Cc: Krzysztof Kozłowski, Wolfram Sang, Dave Airlie,
linux-kernel@vger.kernel.org, Doug Anderson, Andrew Duggan,
Kukjin Kim, Borislav Petkov, linux-arm-kernel@lists.infradead.org,
dougthompson, chuansheng.liu, Guenter Roeck,
linux-i2c@vger.kernel.org
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
* Re: [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
Cc: Krzysztof Kozłowski, Wolfram Sang, Dave Airlie,
Linus Walleij, linux-kernel@vger.kernel.org, Doug Anderson,
Baole Ni, Andrew Duggan, Kukjin Kim, Borislav Petkov,
linux-i2c@vger.kernel.org, dougthompson, chuansheng.liu,
Guenter Roeck
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
* Re: [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: Arnd Bergmann
Cc: Krzysztof Kozłowski, Dave Airlie, Linus Walleij,
linux-kernel@vger.kernel.org, Doug Anderson, Baole Ni,
Andrew Duggan, Kukjin Kim, Borislav Petkov, Guenter Roeck,
dougthompson, chuansheng.liu, linux-arm-kernel,
linux-i2c@vger.kernel.org
[-- Attachment #1.1: Type: text/plain, Size: 322 bytes --]
> > 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 :(
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ 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).