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


Groups > linux.kernel > #1454059

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

From Baole Ni <baolex.ni@intel.com>
Newsgroups linux.kernel
Subject [PATCH 0809/1285] Replace numeric parameter like 0444 with macro
Date 2016-08-02 14:30 +0200
Message-ID <s1GZz-4ne-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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/ntb/test/ntb_perf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index 8dfce9c..7c67b88 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -84,15 +84,15 @@ MODULE_DESCRIPTION(DRIVER_DESCRIPTION);
 static struct dentry *perf_debugfs_dir;
 
 static unsigned int seg_order = 19; /* 512K */
-module_param(seg_order, uint, 0644);
+module_param(seg_order, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(seg_order, "size order [n^2] of buffer segment for testing");
 
 static unsigned int run_order = 32; /* 4G */
-module_param(run_order, uint, 0644);
+module_param(run_order, uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(run_order, "size order [n^2] of total data to transfer");
 
 static bool use_dma; /* default to 0 */
-module_param(use_dma, bool, 0644);
+module_param(use_dma, bool, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(use_dma, "Using DMA engine to measure performance");
 
 struct perf_mw {
-- 
2.9.2

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


Thread

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

csiph-web