From: Baole Ni <baolex.ni@intel.com>
To: anton@enomsg.org, ccross@android.com, keescook@chromium.org,
tony.luck@intel.com, tomi.valkeinen@ti.com, m.chehab@samsung.com,
gregkh@linuxfoundation.org, m.szyprowski@samsung.com,
kyungmin.park@samsung.com, k.kozlowski@samsung.com
Cc: linux-kernel@vger.kernel.org, chuansheng.liu@intel.com,
baolex.ni@intel.com, akpm@linux-foundation.org,
hannes@cmpxchg.org, kirill.shutemov@linux.intel.com,
vdavydov@virtuozzo.com, oneukum@suse.com
Subject: [PATCH 1059/1285] Replace numeric parameter like 0444 with macro
Date: Tue, 2 Aug 2016 20:12:40 +0800 [thread overview]
Message-ID: <20160802121240.20710-1-baolex.ni@intel.com> (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>
---
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
reply other threads:[~2016-08-02 12:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160802121240.20710-1-baolex.ni@intel.com \
--to=baolex.ni@intel.com \
--cc=akpm@linux-foundation.org \
--cc=anton@enomsg.org \
--cc=ccross@android.com \
--cc=chuansheng.liu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hannes@cmpxchg.org \
--cc=k.kozlowski@samsung.com \
--cc=keescook@chromium.org \
--cc=kirill.shutemov@linux.intel.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=m.szyprowski@samsung.com \
--cc=oneukum@suse.com \
--cc=tomi.valkeinen@ti.com \
--cc=tony.luck@intel.com \
--cc=vdavydov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®