linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0252/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 10:53 Baole Ni
  2016-08-03 18:32 ` ira.weiny
  0 siblings, 1 reply; 2+ messages in thread
From: Baole Ni @ 2016-08-02 10:53 UTC (permalink / raw)
  To: dledford, sean.hefty, hal.rosenstock, airlied, kgene,
	k.kozlowski, dougthompson, bp
  Cc: linux-rdma, linux-kernel, ira.weiny, sagi, hch, matanb, markb,
	jgunthorpe, dean.luick, 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/core/mad.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 2d49228..d78e96f 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -52,9 +52,9 @@
 static int mad_sendq_size = IB_MAD_QP_SEND_SIZE;
 static int mad_recvq_size = IB_MAD_QP_RECV_SIZE;
 
-module_param_named(send_queue_size, mad_sendq_size, int, 0444);
+module_param_named(send_queue_size, mad_sendq_size, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(send_queue_size, "Size of send queue in number of work requests");
-module_param_named(recv_queue_size, mad_recvq_size, int, 0444);
+module_param_named(recv_queue_size, mad_recvq_size, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests");
 
 static struct list_head ib_mad_port_list;
-- 
2.9.2

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

* Re: [PATCH 0252/1285] Replace numeric parameter like 0444 with macro
  2016-08-02 10:53 [PATCH 0252/1285] Replace numeric parameter like 0444 with macro Baole Ni
@ 2016-08-03 18:32 ` ira.weiny
  0 siblings, 0 replies; 2+ messages in thread
From: ira.weiny @ 2016-08-03 18:32 UTC (permalink / raw)
  To: Baole Ni
  Cc: dledford, sean.hefty, hal.rosenstock, airlied, kgene,
	k.kozlowski, dougthompson, bp, linux-rdma, linux-kernel, sagi,
	hch, matanb, markb, jgunthorpe, dean.luick, chuansheng.liu

On Tue, Aug 02, 2016 at 06:53:28PM +0800, Baole Ni wrote:
> 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>

Reviewed-by: Ira Weiny <ira.weiny@intel.com>

> ---
>  drivers/infiniband/core/mad.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
> index 2d49228..d78e96f 100644
> --- a/drivers/infiniband/core/mad.c
> +++ b/drivers/infiniband/core/mad.c
> @@ -52,9 +52,9 @@
>  static int mad_sendq_size = IB_MAD_QP_SEND_SIZE;
>  static int mad_recvq_size = IB_MAD_QP_RECV_SIZE;
>  
> -module_param_named(send_queue_size, mad_sendq_size, int, 0444);
> +module_param_named(send_queue_size, mad_sendq_size, int, S_IRUSR | S_IRGRP | S_IROTH);
>  MODULE_PARM_DESC(send_queue_size, "Size of send queue in number of work requests");
> -module_param_named(recv_queue_size, mad_recvq_size, int, 0444);
> +module_param_named(recv_queue_size, mad_recvq_size, int, S_IRUSR | S_IRGRP | S_IROTH);
>  MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests");
>  
>  static struct list_head ib_mad_port_list;
> -- 
> 2.9.2
> 

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

end of thread, other threads:[~2016-08-03 18:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 10:53 [PATCH 0252/1285] Replace numeric parameter like 0444 with macro Baole Ni
2016-08-03 18:32 ` ira.weiny

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).