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

From: Baole Ni
Date: Tue Aug 02 2016 - 07:15:42 EST


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@xxxxxxxxx>
Signed-off-by: Baole Ni <baolex.ni@xxxxxxxxx>
---
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