Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1455953

Re: [PATCH 0252/1285] Replace numeric parameter like 0444 with macro

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From "ira.weiny" <ira.weiny@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0252/1285] Replace numeric parameter like 0444 with macro
Date Wed, 03 Aug 2016 20:40:02 +0200
Message-ID <s29fc-6dM-23@gated-at.bofh.it> (permalink)
References <s1LZg-7Ht-9@gated-at.bofh.it>
X-Extloop1 1
X-Ironport-Av E=Sophos;i="5.28,466,1464678000"; d="scan'208";a="150117960"
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.4.2.2i
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 35
Organization linux.* mail to news gateway
X-Original-Cc dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, airlied@linux.ie, kgene@kernel.org, k.kozlowski@samsung.com, dougthompson@xmission.com, bp@alien8.de, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, sagi@grimberg.me, hch@infradead.org, matanb@mellanox.com, markb@mellanox.com, jgunthorpe@obsidianresearch.com, dean.luick@intel.com, chuansheng.liu@intel.com
X-Original-Date Wed, 3 Aug 2016 14:32:34 -0400
X-Original-Message-ID <20160803183233.GA22334@phlsvsds.ph.intel.com>
X-Original-References <20160802105328.30539-1-baolex.ni@intel.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1455953

Show key headers only | View raw


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
> 

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 0252/1285] Replace numeric parameter like 0444 with macro Baole Ni <baolex.ni@intel.com> - 2016-08-02 19:50 +0200
  Re: [PATCH 0252/1285] Replace numeric parameter like 0444 with macro "ira.weiny" <ira.weiny@intel.com> - 2016-08-03 20:40 +0200

csiph-web