mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1059/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 12:12 Baole Ni
  0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 12:12 UTC (permalink / raw)
  To: anton, ccross, keescook, tony.luck, tomi.valkeinen, m.chehab,
	gregkh, m.szyprowski, kyungmin.park, k.kozlowski
  Cc: linux-kernel, chuansheng.liu, baolex.ni, akpm, hannes,
	kirill.shutemov, vdavydov, oneukum

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>
---
 fs/pstore/ram.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
index bd9812e..7ba7921 100644
--- a/fs/pstore/ram.c
+++ b/fs/pstore/ram.c
@@ -39,44 +39,44 @@
 #define MIN_MEM_SIZE 4096UL
 
 static ulong record_size = MIN_MEM_SIZE;
-module_param(record_size, ulong, 0400);
+module_param(record_size, ulong, S_IRUSR);
 MODULE_PARM_DESC(record_size,
 		"size of each dump done on oops/panic");
 
 static ulong ramoops_console_size = MIN_MEM_SIZE;
-module_param_named(console_size, ramoops_console_size, ulong, 0400);
+module_param_named(console_size, ramoops_console_size, ulong, S_IRUSR);
 MODULE_PARM_DESC(console_size, "size of kernel console log");
 
 static ulong ramoops_ftrace_size = MIN_MEM_SIZE;
-module_param_named(ftrace_size, ramoops_ftrace_size, ulong, 0400);
+module_param_named(ftrace_size, ramoops_ftrace_size, ulong, S_IRUSR);
 MODULE_PARM_DESC(ftrace_size, "size of ftrace log");
 
 static ulong ramoops_pmsg_size = MIN_MEM_SIZE;
-module_param_named(pmsg_size, ramoops_pmsg_size, ulong, 0400);
+module_param_named(pmsg_size, ramoops_pmsg_size, ulong, S_IRUSR);
 MODULE_PARM_DESC(pmsg_size, "size of user space message log");
 
 static unsigned long long mem_address;
-module_param(mem_address, ullong, 0400);
+module_param(mem_address, ullong, S_IRUSR);
 MODULE_PARM_DESC(mem_address,
 		"start of reserved RAM used to store oops/panic logs");
 
 static ulong mem_size;
-module_param(mem_size, ulong, 0400);
+module_param(mem_size, ulong, S_IRUSR);
 MODULE_PARM_DESC(mem_size,
 		"size of reserved RAM used to store oops/panic logs");
 
 static unsigned int mem_type;
-module_param(mem_type, uint, 0600);
+module_param(mem_type, uint, S_IRUSR | S_IWUSR);
 MODULE_PARM_DESC(mem_type,
 		"set to 1 to try to use unbuffered memory (default 0)");
 
 static int dump_oops = 1;
-module_param(dump_oops, int, 0600);
+module_param(dump_oops, int, S_IRUSR | S_IWUSR);
 MODULE_PARM_DESC(dump_oops,
 		"set to 1 to dump oopses, 0 to only dump panics (default 1)");
 
 static int ramoops_ecc;
-module_param_named(ecc, ramoops_ecc, int, 0600);
+module_param_named(ecc, ramoops_ecc, int, S_IRUSR | S_IWUSR);
 MODULE_PARM_DESC(ramoops_ecc,
 		"if non-zero, the option enables ECC support and specifies "
 		"ECC buffer size in bytes (1 is a special value, means 16 "
-- 
2.9.2

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

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

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 12:12 [PATCH 1059/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®