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

From: Baole Ni
Date: Tue Aug 02 2016 - 11:36:21 EST


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@xxxxxxxxx>
Signed-off-by: Baole Ni <baolex.ni@xxxxxxxxx>
---
drivers/net/wireless/intersil/hostap/hostap_hw.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intersil/hostap/hostap_hw.c b/drivers/net/wireless/intersil/hostap/hostap_hw.c
index a8a9bd8..9d7230e 100644
--- a/drivers/net/wireless/intersil/hostap/hostap_hw.c
+++ b/drivers/net/wireless/intersil/hostap/hostap_hw.c
@@ -58,31 +58,31 @@
/* #define final_version */

static int mtu = 1500;
-module_param(mtu, int, 0444);
+module_param(mtu, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(mtu, "Maximum transfer unit");

static int channel[MAX_PARM_DEVICES] = { 3, DEF_INTS };
-module_param_array(channel, int, NULL, 0444);
+module_param_array(channel, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(channel, "Initial channel");

static char essid[33] = "test";
-module_param_string(essid, essid, sizeof(essid), 0444);
+module_param_string(essid, essid, sizeof(essid), S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(essid, "Host AP's ESSID");

static int iw_mode[MAX_PARM_DEVICES] = { IW_MODE_MASTER, DEF_INTS };
-module_param_array(iw_mode, int, NULL, 0444);
+module_param_array(iw_mode, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(iw_mode, "Initial operation mode");

static int beacon_int[MAX_PARM_DEVICES] = { 100, DEF_INTS };
-module_param_array(beacon_int, int, NULL, 0444);
+module_param_array(beacon_int, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(beacon_int, "Beacon interval (1 = 1024 usec)");

static int dtim_period[MAX_PARM_DEVICES] = { 1, DEF_INTS };
-module_param_array(dtim_period, int, NULL, 0444);
+module_param_array(dtim_period, int, NULL, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(dtim_period, "DTIM period");

static char dev_template[16] = "wlan%d";
-module_param_string(dev_template, dev_template, sizeof(dev_template), 0444);
+module_param_string(dev_template, dev_template, sizeof(dev_template), S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(dev_template, "Prefix for network device name (default: "
"wlan%d)");

--
2.9.2