Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1455008 > unrolled thread
| Started by | Baole Ni <baolex.ni@intel.com> |
|---|---|
| First post | 2016-08-02 18:50 +0200 |
| Last post | 2016-08-02 18:50 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0259/1285] Replace numeric parameter like 0444 with macro Baole Ni <baolex.ni@intel.com> - 2016-08-02 18:50 +0200
| From | Baole Ni <baolex.ni@intel.com> |
|---|---|
| Date | 2016-08-02 18:50 +0200 |
| Subject | [PATCH 0259/1285] Replace numeric parameter like 0444 with macro |
| Message-ID | <s1L3c-725-45@gated-at.bofh.it> |
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@intel.com>
Signed-off-by: Baole Ni <baolex.ni@intel.com>
---
drivers/infiniband/hw/i40iw/i40iw_main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c
index c963cad..55da11a 100644
--- a/drivers/infiniband/hw/i40iw/i40iw_main.c
+++ b/drivers/infiniband/hw/i40iw/i40iw_main.c
@@ -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, <e1000-rdma@lists.sourceforge.net>");
--
2.9.2
Back to top | Article view | linux.kernel
csiph-web