[PATCH 0830/1285] Replace numeric parameter like 0444 with macro

Baole Ni baolex.ni at intel.com
Tue Aug 2 04:50:33 PDT 2016


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 at intel.com>
Signed-off-by: Baole Ni <baolex.ni at intel.com>
---
 drivers/pcmcia/i82365.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index eb0d80a..249f29e 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -108,27 +108,27 @@ static int async_clock = -1;
 static int cable_mode = -1;
 static int wakeup = 0;
 
-module_param(i365_base, ulong, 0444);
-module_param(ignore, int, 0444);
-module_param(extra_sockets, int, 0444);
-module_param(irq_mask, int, 0444);
-module_param_array(irq_list, int, &irq_list_count, 0444);
-module_param(cs_irq, int, 0444);
-module_param(async_clock, int, 0444);
-module_param(cable_mode, int, 0444);
-module_param(wakeup, int, 0444);
-
-module_param(do_scan, int, 0444);
-module_param(poll_interval, int, 0444);
-module_param(cycle_time, int, 0444);
-module_param(has_dma, int, 0444);
-module_param(has_led, int, 0444);
-module_param(has_ring, int, 0444);
-module_param(dynamic_mode, int, 0444);
-module_param(freq_bypass, int, 0444);
-module_param(setup_time, int, 0444);
-module_param(cmd_time, int, 0444);
-module_param(recov_time, int, 0444);
+module_param(i365_base, ulong, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(ignore, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(extra_sockets, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(irq_mask, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(irq_list, int, &irq_list_count, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(cs_irq, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(async_clock, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(cable_mode, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(wakeup, int, S_IRUSR | S_IRGRP | S_IROTH);
+
+module_param(do_scan, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(poll_interval, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(cycle_time, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(has_dma, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(has_led, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(has_ring, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(dynamic_mode, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(freq_bypass, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(setup_time, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(cmd_time, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(recov_time, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 /*====================================================================*/
 
-- 
2.9.2




More information about the linux-pcmcia mailing list