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


Groups > linux.kernel > #1455011 > unrolled thread

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

Started byBaole Ni <baolex.ni@intel.com>
First post2016-08-02 18:50 +0200
Last post2016-08-02 18:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0165/1285] Replace numeric parameter like 0444 with macro Baole Ni <baolex.ni@intel.com> - 2016-08-02 18:50 +0200

#1455011 — [PATCH 0165/1285] Replace numeric parameter like 0444 with macro

FromBaole Ni <baolex.ni@intel.com>
Date2016-08-02 18:50 +0200
Subject[PATCH 0165/1285] Replace numeric parameter like 0444 with macro
Message-ID<s1L3d-725-67@gated-at.bofh.it>
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/firewire/ohci.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 8bf8926..39f952b 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -347,7 +347,7 @@ static const struct {
 
 /* This overrides anything that was found in ohci_quirks[]. */
 static int param_quirks;
-module_param_named(quirks, param_quirks, int, 0644);
+module_param_named(quirks, param_quirks, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(quirks, "Chip quirks (default = 0"
 	", nonatomic cycle timer = "	__stringify(QUIRK_CYCLE_TIMER)
 	", reset packet generation = "	__stringify(QUIRK_RESET_PACKET)
@@ -364,7 +364,7 @@ MODULE_PARM_DESC(quirks, "Chip quirks (default = 0"
 #define OHCI_PARAM_DEBUG_BUSRESETS	8 /* only effective before chip init */
 
 static int param_debug;
-module_param_named(debug, param_debug, int, 0644);
+module_param_named(debug, param_debug, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
 	", AT/AR events = "	__stringify(OHCI_PARAM_DEBUG_AT_AR)
 	", self-IDs = "		__stringify(OHCI_PARAM_DEBUG_SELFIDS)
@@ -373,7 +373,7 @@ MODULE_PARM_DESC(debug, "Verbose logging (default = 0"
 	", or a combination, or all = -1)");
 
 static bool param_remote_dma;
-module_param_named(remote_dma, param_remote_dma, bool, 0444);
+module_param_named(remote_dma, param_remote_dma, bool, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(remote_dma, "Enable unfiltered remote DMA (default = N)");
 
 static void log_irqs(struct fw_ohci *ohci, u32 evt)
-- 
2.9.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web