Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

PATCH New Baole Ni 1 participant 1 message Aug 2, 2016 Block layer

lore
Share & tools
lore

Baole Ni

author
#0 lore raw

PATCH 90/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/block/rsxx/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/rsxx/core.c +2 -2
index 34997df..b2b8e40 100644
@@ -49,11 +49,11 @@ MODULE_LICENSE("GPL");
 MODULE_VERSION(DRIVER_VERSION);
 
 static unsigned int force_legacy = NO_LEGACY;
-module_param(force_legacy, uint, 0444);
+module_param(force_legacy, uint, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(force_legacy, "Force the use of legacy type PCI interrupts");
 
 static unsigned int sync_start = 1;
-module_param(sync_start, uint, 0444);
+module_param(sync_start, uint, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(sync_start, "On by Default: Driver load will not complete "
 			     "until the card startup has completed.");
 
Signature · 1 line
2.9.2