Replace numeric parameter like 0444 with macro
PATCH 244/1285 Replace numeric parameter like 0444 with macro
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.
--- drivers/i2c/busses/i2c-stu300.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-stu300.c +1 -1
@@ -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
Signature · 1 line
2.9.2
Quoted 8 lines · Baole 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 <[email protected]>Signed-off-by Baole Ni <[email protected]>
I assume Wolfram will merge this.
Yours,
Linus Walleij
Quoted 8 lines · CEST Linus Walleij
Quoted 6 lines · Baole 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.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Chuansheng Liu <[email protected]>Signed-off-by Baole Ni <[email protected]>Acked-by Linus Walleij <[email protected]>I assume Wolfram will merge this.
I assume not, see http://lwn.net/Articles/696227/
Arnd
Quoted 4 lines
Quoted 2 lines
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>