lkml.org 
[lkml]   [2016]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1059/1285] Replace numeric parameter like 0444 with macro
Date
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
\
 
 \ /
  Last update: 2016-08-02 15:41    [W:0.786 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site