DORMANTno replies

[PATCH 0730/1285] Replace numeric parameter like 0444 with macro

From: Baole Ni <hidden>
Date: 2016-08-02 12:18:58
Also in: lkml
Subsystem: networking drivers, qlogic qlcnic (1/10)gb ethernet driver, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Shahed Shaikh, Manish Chopra, Linus Torvalds

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 <redacted>
Signed-off-by: Baole Ni <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help