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


Groups > linux.kernel > #1454499

Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro

From Marcel Holtmann <marcel@holtmann.org>
Newsgroups linux.kernel
Subject Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro
Date 2016-08-02 16:10 +0200
Message-ID <s1Iyn-5ut-67@gated-at.bofh.it> (permalink)
References <s1IoG-5bC-19@gated-at.bofh.it> <s1IoG-5bC-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Felipe,

>> 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/usb/misc/usbtest.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
>> index 6b978f0..5e81dc3 100644
>> --- a/drivers/usb/misc/usbtest.c
>> +++ b/drivers/usb/misc/usbtest.c
>> @@ -15,7 +15,7 @@
>> /*-------------------------------------------------------------------------*/
>> 
>> static int override_alt = -1;
>> -module_param_named(alt, override_alt, int, 0644);
>> +module_param_named(alt, override_alt, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
> 
> line too long. You need to run this series through scripts/checkpatch.pl

please don't give them any ideas. Next thing you know and another 1285 patch bomb is coming our way.

Regards

Marcel

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro Felipe Balbi <felipe.balbi@linux.intel.com> - 2016-08-02 16:00 +0200
  Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro Marcel Holtmann <marcel@holtmann.org> - 2016-08-02 16:10 +0200
  Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro Marcel Holtmann <marcel@holtmann.org> - 2016-08-02 16:10 +0200
  Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro Michal Nazarewicz <mina86@mina86.com> - 2016-08-03 13:20 +0200
  Re: [PATCH 0984/1285] Replace numeric parameter like 0444 with macro Oliver Neukum <oneukum@suse.com> - 2016-08-03 14:30 +0200

csiph-web