Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

PATCH NAK Baole Ni 1 participant 1 message Aug 2, 2016

Subsystems (2)
lore
Share & tools
lore

Baole Ni

author
#0 lore raw

PATCH 443/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/media/pci/bt8xx/bttv-cards.c | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)
drivers/media/pci/bt8xx/bttv-cards.c +15 -15
index 8a17cc0..a84caf4 100644
@@ -109,21 +109,21 @@ static unsigned int audioall = UNSET;
 static unsigned int audiomux[5] = { [ 0 ... 4 ] = UNSET };
 
 /* insmod options */
-module_param(triton1,    int, 0444);
-module_param(vsfx,       int, 0444);
-module_param(no_overlay, int, 0444);
-module_param(latency,    int, 0444);
-module_param(gpiomask,   int, 0444);
-module_param(audioall,   int, 0444);
-module_param(autoload,   int, 0444);
-
-module_param_array(card,     int, NULL, 0444);
-module_param_array(pll,      int, NULL, 0444);
-module_param_array(tuner,    int, NULL, 0444);
-module_param_array(svhs,     int, NULL, 0444);
-module_param_array(remote,   int, NULL, 0444);
-module_param_array(audiodev, int, NULL, 0444);
-module_param_array(audiomux, int, NULL, 0444);
+module_param(triton1,    int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(vsfx,       int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(no_overlay, int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(latency,    int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(gpiomask,   int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(audioall,   int, S_IRUSR | S_IRGRP | S_IROTH);
+module_param(autoload,   int, S_IRUSR | S_IRGRP | S_IROTH);
+
+module_param_array(card,     int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(pll,      int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(tuner,    int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(svhs,     int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(remote,   int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(audiodev, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
+module_param_array(audiomux, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
 
 MODULE_PARM_DESC(triton1,"set ETBF pci config bit "
 		 "[enable bug compatibility for triton1 + others]");
Signature · 1 line
2.9.2