Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

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

lore
Share & tools
lore

Baole Ni

author
#0 lore raw

PATCH 259/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/infiniband/hw/i40iw/i40iw_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/infiniband/hw/i40iw/i40iw_main.c +5 -5
index c963cad..55da11a 100644
@@ -55,23 +55,23 @@
 	__stringify(DRV_VERSION_MINOR) "." __stringify(DRV_VERSION_BUILD)
 
 static int push_mode;
-module_param(push_mode, int, 0644);
+module_param(push_mode, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(push_mode, "Low latency mode: 0=disabled (default), 1=enabled)");
 
 static int debug;
-module_param(debug, int, 0644);
+module_param(debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(debug, "debug flags: 0=disabled (default), 0x7fffffff=all");
 
 static int resource_profile;
-module_param(resource_profile, int, 0644);
+module_param(resource_profile, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(resource_profile,
 		 "Resource Profile: 0=no VF RDMA support (default), 1=Weighted VF, 2=Even Distribution");
 
 static int max_rdma_vfs = 32;
-module_param(max_rdma_vfs, int, 0644);
+module_param(max_rdma_vfs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(max_rdma_vfs, "Maximum VF count: 0-32 32=default");
 static int mpa_version = 2;
-module_param(mpa_version, int, 0644);
+module_param(mpa_version, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(mpa_version, "MPA version to be used in MPA Req/Resp 1 or 2");
 
 MODULE_AUTHOR("Intel Corporation, <[email protected]>");
Signature · 6 lines
2.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html