From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030432AbcHBRgA (ORCPT ); Tue, 2 Aug 2016 13:36:00 -0400 Received: from mga14.intel.com ([192.55.52.115]:38516 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932334AbcHBLoS (ORCPT ); Tue, 2 Aug 2016 07:44:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,460,1464678000"; d="scan'208";a="1028252174" From: Baole Ni 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 Message-Id: <20160802105526.31882-1-baolex.ni@intel.com> X-Mailer: git-send-email 2.9.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Baole Ni --- 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