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 909/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/scsi/bnx2i/bnx2i_init.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/scsi/bnx2i/bnx2i_init.c +7 -7
index c8b410c..2bdf2cf 100644
@@ -39,31 +39,31 @@ MODULE_VERSION(DRV_MODULE_VERSION);
 static DEFINE_MUTEX(bnx2i_dev_lock);
 
 unsigned int event_coal_min = 24;
-module_param(event_coal_min, int, 0664);
+module_param(event_coal_min, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(event_coal_min, "Event Coalescing Minimum Commands");
 
 unsigned int event_coal_div = 2;
-module_param(event_coal_div, int, 0664);
+module_param(event_coal_div, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(event_coal_div, "Event Coalescing Divide Factor");
 
 unsigned int en_tcp_dack = 1;
-module_param(en_tcp_dack, int, 0664);
+module_param(en_tcp_dack, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(en_tcp_dack, "Enable TCP Delayed ACK");
 
 unsigned int error_mask1 = 0x00;
-module_param(error_mask1, uint, 0664);
+module_param(error_mask1, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(error_mask1, "Config FW iSCSI Error Mask #1");
 
 unsigned int error_mask2 = 0x00;
-module_param(error_mask2, uint, 0664);
+module_param(error_mask2, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(error_mask2, "Config FW iSCSI Error Mask #2");
 
 unsigned int sq_size;
-module_param(sq_size, int, 0664);
+module_param(sq_size, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(sq_size, "Configure SQ size");
 
 unsigned int rq_size = BNX2I_RQ_WQES_DEFAULT;
-module_param(rq_size, int, 0664);
+module_param(rq_size, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 MODULE_PARM_DESC(rq_size, "Configure RQ size");
 
 u64 iscsi_error_mask = 0x00;
Signature · 1 line
2.9.2