All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0253/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 10:53 Baole Ni
  2016-08-02 14:11   ` Steve Wise
  0 siblings, 1 reply; 3+ messages in thread
From: Baole Ni @ 2016-08-02 10:53 UTC (permalink / raw)
  To: swise, dledford, sean.hefty, hal.rosenstock, airlied, kgene,
	k.kozlowski, dougthompson, bp
  Cc: linux-rdma, linux-kernel, chuansheng.liu, baolex.ni, hch, matanb,
	markb, jgunthorpe, dean.luick

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/cxgb3/iwch_cm.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 3e8431b..f38dc0a 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -65,41 +65,41 @@ static char *states[] = {
 };
 
 int peer2peer = 0;
-module_param(peer2peer, int, 0644);
+module_param(peer2peer, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(peer2peer, "Support peer2peer ULPs (default=0)");
 
 static int ep_timeout_secs = 60;
-module_param(ep_timeout_secs, int, 0644);
+module_param(ep_timeout_secs, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(ep_timeout_secs, "CM Endpoint operation timeout "
 				   "in seconds (default=60)");
 
 static int mpa_rev = 1;
-module_param(mpa_rev, int, 0644);
+module_param(mpa_rev, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(mpa_rev, "MPA Revision, 0 supports amso1100, "
 		 "1 is spec compliant. (default=1)");
 
 static int markers_enabled = 0;
-module_param(markers_enabled, int, 0644);
+module_param(markers_enabled, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(markers_enabled, "Enable MPA MARKERS (default(0)=disabled)");
 
 static int crc_enabled = 1;
-module_param(crc_enabled, int, 0644);
+module_param(crc_enabled, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(crc_enabled, "Enable MPA CRC (default(1)=enabled)");
 
 static int rcv_win = 256 * 1024;
-module_param(rcv_win, int, 0644);
+module_param(rcv_win, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(rcv_win, "TCP receive window in bytes (default=256)");
 
 static int snd_win = 32 * 1024;
-module_param(snd_win, int, 0644);
+module_param(snd_win, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(snd_win, "TCP send window in bytes (default=32KB)");
 
 static unsigned int nocong = 0;
-module_param(nocong, uint, 0644);
+module_param(nocong, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(nocong, "Turn off congestion control (default=0)");
 
 static unsigned int cong_flavor = 1;
-module_param(cong_flavor, uint, 0644);
+module_param(cong_flavor, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(cong_flavor, "TCP Congestion control flavor (default=1)");
 
 static struct workqueue_struct *workq;
-- 
2.9.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH 0253/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 10:53 [PATCH 0253/1285] Replace numeric parameter like 0444 with macro Baole Ni
@ 2016-08-02 14:11   ` Steve Wise
  0 siblings, 0 replies; 3+ messages in thread
From: Steve Wise @ 2016-08-02 14:11 UTC (permalink / raw)
  To: 'Baole Ni',
	swise, dledford, sean.hefty, hal.rosenstock, airlied, kgene,
	k.kozlowski, dougthompson, bp
  Cc: linux-rdma, linux-kernel, chuansheng.liu, hch, matanb, markb,
	jgunthorpe, dean.luick

Acked-by: Steve Wise <swise@opengridcomputing.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH 0253/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 14:11   ` Steve Wise
  0 siblings, 0 replies; 3+ messages in thread
From: Steve Wise @ 2016-08-02 14:11 UTC (permalink / raw)
  To: 'Baole Ni',
	swise, dledford, sean.hefty, hal.rosenstock, airlied, kgene,
	k.kozlowski, dougthompson, bp
  Cc: linux-rdma, linux-kernel, chuansheng.liu, hch, matanb, markb,
	jgunthorpe, dean.luick

Acked-by: Steve Wise <swise@opengridcomputing.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-02 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 10:53 [PATCH 0253/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-02 14:11 ` Steve Wise
2016-08-02 14:11   ` Steve Wise

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.