linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0273/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 10:55 Baole Ni
  0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 10:55 UTC (permalink / raw)
  To: dledford, sean.hefty, hal.rosenstock, bp
  Cc: linux-rdma, linux-kernel, bart.vanassche, sagig, alex.estrin,
	nab, haggaie, chuansheng.liu, baolex.ni

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/ulp/srpt/ib_srpt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index e68b20cb..291334e 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -71,12 +71,12 @@ static DEFINE_SPINLOCK(srpt_dev_lock);	/* Protects srpt_dev_list. */
 static LIST_HEAD(srpt_dev_list);	/* List of srpt_device structures. */
 
 static unsigned srp_max_req_size = DEFAULT_MAX_REQ_SIZE;
-module_param(srp_max_req_size, int, 0444);
+module_param(srp_max_req_size, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(srp_max_req_size,
 		 "Maximum size of SRP request messages in bytes.");
 
 static int srpt_srq_size = DEFAULT_SRPT_SRQ_SIZE;
-module_param(srpt_srq_size, int, 0444);
+module_param(srpt_srq_size, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(srpt_srq_size,
 		 "Shared receive queue (SRQ) size.");
 
@@ -85,7 +85,7 @@ static int srpt_get_u64_x(char *buffer, struct kernel_param *kp)
 	return sprintf(buffer, "0x%016llx", *(u64 *)kp->arg);
 }
 module_param_call(srpt_service_guid, NULL, srpt_get_u64_x, &srpt_service_guid,
-		  0444);
+		  S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(srpt_service_guid,
 		 "Using this value for ioc_guid, id_ext, and cm_listen_id"
 		 " instead of using the node_guid of the first HCA.");
-- 
2.9.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-02 17:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 10:55 [PATCH 0273/1285] Replace numeric parameter like 0444 with macro Baole Ni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).