[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20160802120147.13302-1-baolex.ni@intel.com>
Date: Tue, 2 Aug 2016 20:01:47 +0800
From: Baole Ni <baolex.ni@...el.com>
To: gregkh@...uxfoundation.org, maurochehab@...il.com,
mchehab@...radead.org, mchehab@...hat.com, m.chehab@...sung.com,
m.szyprowski@...sung.com, kyungmin.park@...sung.com,
k.kozlowski@...sung.com
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
aaro.koskinen@....fi, david.daney@...ium.com, nevola@...il.com,
cristina.moraru09@...il.com, aybuke.147@...il.com,
bhaktipriya96@...il.com, chuansheng.liu@...el.com,
baolex.ni@...el.com
Subject: [PATCH 0949/1285] Replace numeric parameter like 0444 with macro
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@...el.com>
Signed-off-by: Baole Ni <baolex.ni@...el.com>
---
drivers/staging/octeon/ethernet.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index e9cd5f2..d0841ed 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -40,13 +40,13 @@
#include <asm/octeon/cvmx-smix-defs.h>
static int num_packet_buffers = 1024;
-module_param(num_packet_buffers, int, 0444);
+module_param(num_packet_buffers, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(num_packet_buffers, "\n"
"\tNumber of packet buffers to allocate and store in the\n"
"\tFPA. By default, 1024 packet buffers are used.\n");
int pow_receive_group = 15;
-module_param(pow_receive_group, int, 0444);
+module_param(pow_receive_group, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pow_receive_group, "\n"
"\tPOW group to receive packets from. All ethernet hardware\n"
"\twill be configured to send incoming packets to this POW\n"
@@ -54,14 +54,14 @@ MODULE_PARM_DESC(pow_receive_group, "\n"
"\tgroup for the kernel to process.");
int pow_send_group = -1;
-module_param(pow_send_group, int, 0644);
+module_param(pow_send_group, int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pow_send_group, "\n"
"\tPOW group to send packets to other software on. This\n"
"\tcontrols the creation of the virtual device pow0.\n"
"\talways_use_pow also depends on this value.");
int always_use_pow;
-module_param(always_use_pow, int, 0444);
+module_param(always_use_pow, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(always_use_pow, "\n"
"\tWhen set, always send to the pow group. This will cause\n"
"\tpackets sent to real ethernet devices to be sent to the\n"
@@ -73,7 +73,7 @@ MODULE_PARM_DESC(always_use_pow, "\n"
"\tthis option.");
char pow_send_list[128] = "";
-module_param_string(pow_send_list, pow_send_list, sizeof(pow_send_list), 0444);
+module_param_string(pow_send_list, pow_send_list, sizeof(pow_send_list), S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(pow_send_list, "\n"
"\tComma separated list of ethernet devices that should use the\n"
"\tPOW for transmit instead of the actual ethernet hardware. This\n"
@@ -83,7 +83,7 @@ MODULE_PARM_DESC(pow_send_list, "\n"
"\tusing the pow_send_group.");
int rx_napi_weight = 32;
-module_param(rx_napi_weight, int, 0444);
+module_param(rx_napi_weight, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(rx_napi_weight, "The NAPI WEIGHT parameter.");
--
2.9.2
Powered by blists - more mailing lists