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

Baole Ni baolex.ni at intel.com
Tue Aug 2 04:51:18 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/yenta_socket.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index 5d6d9b1..1fa8ead 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -25,19 +25,19 @@
 #include "i82365.h"
 
 static bool disable_clkrun;
-module_param(disable_clkrun, bool, 0444);
+module_param(disable_clkrun, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(disable_clkrun, "If PC card doesn't function properly, please try this option");
 
 static bool isa_probe = 1;
-module_param(isa_probe, bool, 0444);
+module_param(isa_probe, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(isa_probe, "If set ISA interrupts are probed (default). Set to N to disable probing");
 
 static bool pwr_irqs_off;
-module_param(pwr_irqs_off, bool, 0644);
+module_param(pwr_irqs_off, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(pwr_irqs_off, "Force IRQs off during power-on of slot. Use only when seeing IRQ storms!");
 
 static char o2_speedup[] = "default";
-module_param_string(o2_speedup, o2_speedup, sizeof(o2_speedup), 0444);
+module_param_string(o2_speedup, o2_speedup, sizeof(o2_speedup), S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(o2_speedup, "Use prefetch/burst for O2-bridges: 'on', 'off' "
 	"or 'default' (uses recommended behaviour for the detected bridge)");
 
-- 
2.9.2




More information about the linux-pcmcia mailing list