mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0730/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 11:40 Baole Ni
  0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 11:40 UTC (permalink / raw)
  To: Dept-GELinuxNICDev, sony.chacko, rajesh.borundia, mpe,
	computersforpeace, m.chehab, pawel, m.szyprowski, kyungmin.park,
	k.kozlowski
  Cc: netdev, linux-kernel, chuansheng.liu, baolex.ni, romieu, Baohua.Song

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/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 1c29105..7c5c9b5 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -34,25 +34,25 @@ static const char qlcnic_driver_string[] = "QLogic 1/10 GbE "
 	"Converged/Intelligent Ethernet Driver v" QLCNIC_LINUX_VERSIONID;
 
 static int qlcnic_mac_learn;
-module_param(qlcnic_mac_learn, int, 0444);
+module_param(qlcnic_mac_learn, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(qlcnic_mac_learn,
 		 "Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)");
 
 int qlcnic_use_msi = 1;
 MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled)");
-module_param_named(use_msi, qlcnic_use_msi, int, 0444);
+module_param_named(use_msi, qlcnic_use_msi, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 int qlcnic_use_msi_x = 1;
 MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled)");
-module_param_named(use_msi_x, qlcnic_use_msi_x, int, 0444);
+module_param_named(use_msi_x, qlcnic_use_msi_x, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 int qlcnic_auto_fw_reset = 1;
 MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled)");
-module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, 0644);
+module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 int qlcnic_load_fw_file;
 MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file, 2=POST in fast mode, 3= POST in medium mode, 4=POST in slow mode)");
-module_param_named(load_fw_file, qlcnic_load_fw_file, int, 0444);
+module_param_named(load_fw_file, qlcnic_load_fw_file, int, S_IRUSR | S_IRGRP | S_IROTH);
 
 static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
 static void qlcnic_remove(struct pci_dev *pdev);
-- 
2.9.2

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-02 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 11:40 [PATCH 0730/1285] Replace numeric parameter like 0444 with macro Baole Ni

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®