mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org
Cc: linux-kernel@vger.kernel.org, gbeshers@sgi.com,
	akpm@linux-foundation.org, dyoung@redhat.com, travis@sgi.com,
	chuansheng.liu@intel.com, baolex.ni@intel.com
Subject: [PATCH 0038/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 18:36:19 +0800	[thread overview]
Message-ID: <20160802103619.16307-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>
---
 arch/x86/platform/uv/uv_nmi.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c
index 8dd8005..85a4fb0 100644
--- a/arch/x86/platform/uv/uv_nmi.c
+++ b/arch/x86/platform/uv/uv_nmi.c
@@ -87,7 +87,7 @@ static cpumask_var_t uv_nmi_cpu_mask;
  * Lower level to send to log buffer only.
  */
 static int uv_nmi_loglevel = CONSOLE_LOGLEVEL_DEFAULT;
-module_param_named(dump_loglevel, uv_nmi_loglevel, int, 0644);
+module_param_named(dump_loglevel, uv_nmi_loglevel, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 /*
  * The following values show statistics on how perf events are affecting
@@ -112,37 +112,37 @@ static const struct kernel_param_ops param_ops_local64 = {
 #define param_check_local64(name, p) __param_check(name, p, local64_t)
 
 static local64_t uv_nmi_count;
-module_param_named(nmi_count, uv_nmi_count, local64, 0644);
+module_param_named(nmi_count, uv_nmi_count, local64, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static local64_t uv_nmi_misses;
-module_param_named(nmi_misses, uv_nmi_misses, local64, 0644);
+module_param_named(nmi_misses, uv_nmi_misses, local64, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static local64_t uv_nmi_ping_count;
-module_param_named(ping_count, uv_nmi_ping_count, local64, 0644);
+module_param_named(ping_count, uv_nmi_ping_count, local64, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static local64_t uv_nmi_ping_misses;
-module_param_named(ping_misses, uv_nmi_ping_misses, local64, 0644);
+module_param_named(ping_misses, uv_nmi_ping_misses, local64, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 /*
  * Following values allow tuning for large systems under heavy loading
  */
 static int uv_nmi_initial_delay = 100;
-module_param_named(initial_delay, uv_nmi_initial_delay, int, 0644);
+module_param_named(initial_delay, uv_nmi_initial_delay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int uv_nmi_slave_delay = 100;
-module_param_named(slave_delay, uv_nmi_slave_delay, int, 0644);
+module_param_named(slave_delay, uv_nmi_slave_delay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int uv_nmi_loop_delay = 100;
-module_param_named(loop_delay, uv_nmi_loop_delay, int, 0644);
+module_param_named(loop_delay, uv_nmi_loop_delay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int uv_nmi_trigger_delay = 10000;
-module_param_named(trigger_delay, uv_nmi_trigger_delay, int, 0644);
+module_param_named(trigger_delay, uv_nmi_trigger_delay, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int uv_nmi_wait_count = 100;
-module_param_named(wait_count, uv_nmi_wait_count, int, 0644);
+module_param_named(wait_count, uv_nmi_wait_count, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static int uv_nmi_retry_count = 500;
-module_param_named(retry_count, uv_nmi_retry_count, int, 0644);
+module_param_named(retry_count, uv_nmi_retry_count, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 /*
  * Valid NMI Actions:
@@ -153,7 +153,7 @@ module_param_named(retry_count, uv_nmi_retry_count, int, 0644);
  *  "kgdb"	- enter KGDB
  */
 static char uv_nmi_action[8] = "kdb";
-module_param_string(action, uv_nmi_action, sizeof(uv_nmi_action), 0644);
+module_param_string(action, uv_nmi_action, sizeof(uv_nmi_action), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static inline bool uv_nmi_action_is(const char *action)
 {
-- 
2.9.2

                 reply	other threads:[~2016-08-02 11:15 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=20160802103619.16307-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=chuansheng.liu@intel.com \
    --cc=dyoung@redhat.com \
    --cc=gbeshers@sgi.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=travis@sgi.com \
    --cc=x86@kernel.org \
    /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®