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

From: Baole Ni
Date: Tue Aug 02 2016 - 13:36:05 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/infiniband/ulp/srp/ib_srp.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 3322ed7..ac2cd92 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -73,34 +73,34 @@ static bool register_always = true;
static bool never_register;
static int topspin_workarounds = 1;

-module_param(srp_sg_tablesize, uint, 0444);
+module_param(srp_sg_tablesize, uint, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(srp_sg_tablesize, "Deprecated name for cmd_sg_entries");

-module_param(cmd_sg_entries, uint, 0444);
+module_param(cmd_sg_entries, uint, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(cmd_sg_entries,
"Default number of gather/scatter entries in the SRP command (default is 12, max 255)");

-module_param(indirect_sg_entries, uint, 0444);
+module_param(indirect_sg_entries, uint, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(indirect_sg_entries,
"Default max number of gather/scatter entries (default is 12, max is " __stringify(SG_MAX_SEGMENTS) ")");

-module_param(allow_ext_sg, bool, 0444);
+module_param(allow_ext_sg, bool, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(allow_ext_sg,
"Default behavior when there are more than cmd_sg_entries S/G entries after mapping; fails the request when false (default false)");

-module_param(topspin_workarounds, int, 0444);
+module_param(topspin_workarounds, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(topspin_workarounds,
"Enable workarounds for Topspin/Cisco SRP target bugs if != 0");

-module_param(prefer_fr, bool, 0444);
+module_param(prefer_fr, bool, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(prefer_fr,
"Whether to use fast registration if both FMR and fast registration are supported");

-module_param(register_always, bool, 0444);
+module_param(register_always, bool, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(register_always,
"Use memory registration even for contiguous memory regions");

-module_param(never_register, bool, 0444);
+module_param(never_register, bool, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(never_register, "Never register memory");

static const struct kernel_param_ops srp_tmo_ops;
@@ -130,7 +130,7 @@ MODULE_PARM_DESC(dev_loss_tmo,
" this functionality is disabled.");

static unsigned ch_count;
-module_param(ch_count, uint, 0444);
+module_param(ch_count, uint, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(ch_count,
"Number of RDMA channels to use for communication with an SRP target. Using more than one channel improves performance if the HCA supports multiple completion vectors. The default value is the minimum of four times the number of online CPU sockets and the number of completion vectors supported by the HCA.");

--
2.9.2