mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: gregkh@linuxfoundation.org, maurochehab@gmail.com,
	mchehab@infradead.org, mchehab@redhat.com, m.chehab@samsung.com,
	m.szyprowski@samsung.com, kyungmin.park@samsung.com,
	k.kozlowski@samsung.com
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	aaro.koskinen@iki.fi, david.daney@cavium.com, nevola@gmail.com,
	cristina.moraru09@gmail.com, aybuke.147@gmail.com,
	bhaktipriya96@gmail.com, chuansheng.liu@intel.com,
	baolex.ni@intel.com
Subject: [PATCH 0949/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 20:01:47 +0800	[thread overview]
Message-ID: <20160802120147.13302-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>
---
 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

                 reply	other threads:[~2016-08-02 12:39 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=20160802120147.13302-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=aybuke.147@gmail.com \
    --cc=bhaktipriya96@gmail.com \
    --cc=chuansheng.liu@intel.com \
    --cc=cristina.moraru09@gmail.com \
    --cc=david.daney@cavium.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=m.szyprowski@samsung.com \
    --cc=maurochehab@gmail.com \
    --cc=mchehab@infradead.org \
    --cc=mchehab@redhat.com \
    --cc=nevola@gmail.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®