From: Baole Ni <baolex.ni@intel.com>
To: jussi.kivilinna@iki.fi, kvalo@codeaurora.org,
linuxwifi@intel.com, m.chehab@samsung.com, pawel@osciak.com,
m.szyprowski@samsung.com, kyungmin.park@samsung.com,
k.kozlowski@samsung.com
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, chuansheng.liu@intel.com,
baolex.ni@intel.com
Subject: [PATCH 0802/1285] Replace numeric parameter like 0444 with macro
Date: Tue, 2 Aug 2016 19:47:58 +0800 [thread overview]
Message-ID: <20160802114758.3433-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/net/wireless/rndis_wlan.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 569918c..f6317d7 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -46,43 +46,43 @@
/* NOTE: All these are settings for Broadcom chipset */
static char modparam_country[4] = "EU";
-module_param_string(country, modparam_country, 4, 0444);
+module_param_string(country, modparam_country, 4, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(country, "Country code (ISO 3166-1 alpha-2), default: EU");
static int modparam_frameburst = 1;
-module_param_named(frameburst, modparam_frameburst, int, 0444);
+module_param_named(frameburst, modparam_frameburst, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(frameburst, "enable frame bursting (default: on)");
static int modparam_afterburner = 0;
-module_param_named(afterburner, modparam_afterburner, int, 0444);
+module_param_named(afterburner, modparam_afterburner, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(afterburner,
"enable afterburner aka '125 High Speed Mode' (default: off)");
static int modparam_power_save = 0;
-module_param_named(power_save, modparam_power_save, int, 0444);
+module_param_named(power_save, modparam_power_save, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(power_save,
"set power save mode: 0=off, 1=on, 2=fast (default: off)");
static int modparam_power_output = 3;
-module_param_named(power_output, modparam_power_output, int, 0444);
+module_param_named(power_output, modparam_power_output, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(power_output,
"set power output: 0=25%, 1=50%, 2=75%, 3=100% (default: 100%)");
static int modparam_roamtrigger = -70;
-module_param_named(roamtrigger, modparam_roamtrigger, int, 0444);
+module_param_named(roamtrigger, modparam_roamtrigger, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(roamtrigger,
"set roaming dBm trigger: -80=optimize for distance, "
"-60=bandwidth (default: -70)");
static int modparam_roamdelta = 1;
-module_param_named(roamdelta, modparam_roamdelta, int, 0444);
+module_param_named(roamdelta, modparam_roamdelta, int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(roamdelta,
"set roaming tendency: 0=aggressive, 1=moderate, "
"2=conservative (default: moderate)");
static int modparam_workaround_interval;
module_param_named(workaround_interval, modparam_workaround_interval,
- int, 0444);
+ int, S_IRUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(workaround_interval,
"set stall workaround interval in msecs (0=disabled) (default: 0)");
--
2.9.2
reply other threads:[~2016-08-02 12:26 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=20160802114758.3433-1-baolex.ni@intel.com \
--to=baolex.ni@intel.com \
--cc=chuansheng.liu@intel.com \
--cc=jussi.kivilinna@iki.fi \
--cc=k.kozlowski@samsung.com \
--cc=kvalo@codeaurora.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linuxwifi@intel.com \
--cc=m.chehab@samsung.com \
--cc=m.szyprowski@samsung.com \
--cc=netdev@vger.kernel.org \
--cc=pawel@osciak.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