mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: bart.vanassche@sandisk.com, dledford@redhat.com,
	sean.hefty@intel.com, hal.rosenstock@gmail.com, bp@alien8.de
Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	chuansheng.liu@intel.com, baolex.ni@intel.com,
	jgunthorpe@obsidianresearch.com, erezsh@mellanox.com,
	matanb@mellanox.com, alex.estrin@intel.com
Subject: [PATCH 0272/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 18:55:26 +0800	[thread overview]
Message-ID: <20160802105526.31882-1-baolex.ni@intel.com> (raw)

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/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

                 reply	other threads:[~2016-08-02 17:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160802105526.31882-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=alex.estrin@intel.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=bp@alien8.de \
    --cc=chuansheng.liu@intel.com \
    --cc=dledford@redhat.com \
    --cc=erezsh@mellanox.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=matanb@mellanox.com \
    --cc=sean.hefty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®