mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baole Ni <baolex.ni@intel.com>
To: malattia@linux.it, dvhart@infradead.org, jgross@suse.com,
	bhelgaas@google.com, m.chehab@samsung.com, pawel@osciak.com,
	m.szyprowski@samsung.com, kyungmin.park@samsung.com,
	k.kozlowski@samsung.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, chuansheng.liu@intel.com,
	baolex.ni@intel.com
Subject: [PATCH 0856/1285] Replace numeric parameter like 0444 with macro
Date: Tue,  2 Aug 2016 19:52:45 +0800	[thread overview]
Message-ID: <20160802115245.7052-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/platform/x86/sony-laptop.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 1dba359..408bbe5 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -95,22 +95,22 @@ MODULE_PARM_DESC(debug, "set this to 1 (and RTFM) if you want to help "
 		 "the development of this driver");
 
 static int no_spic;		/* = 0 */
-module_param(no_spic, int, 0444);
+module_param(no_spic, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(no_spic,
 		 "set this if you don't want to enable the SPIC device");
 
 static int compat;		/* = 0 */
-module_param(compat, int, 0444);
+module_param(compat, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(compat,
 		 "set this if you want to enable backward compatibility mode");
 
 static unsigned long mask = 0xffffffff;
-module_param(mask, ulong, 0644);
+module_param(mask, ulong, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(mask,
 		 "set this to the mask of event you want to enable (see doc)");
 
 static int camera;		/* = 0 */
-module_param(camera, int, 0444);
+module_param(camera, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(camera,
 		 "set this to 1 to enable Motion Eye camera controls "
 		 "(only use it if you have a C1VE or C1VN model)");
@@ -124,14 +124,14 @@ MODULE_PARM_DESC(minor,
 #endif
 
 static int kbd_backlight = -1;
-module_param(kbd_backlight, int, 0444);
+module_param(kbd_backlight, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(kbd_backlight,
 		 "set this to 0 to disable keyboard backlight, "
 		 "1 to enable it with automatic control and 2 to have it always "
 		 "on (default: no change from current value)");
 
 static int kbd_backlight_timeout = -1;
-module_param(kbd_backlight_timeout, int, 0444);
+module_param(kbd_backlight_timeout, int, S_IRUSR | S_IRGRP | S_IROTH);
 MODULE_PARM_DESC(kbd_backlight_timeout,
 		 "meaningful values vary from 0 to 3 and their meaning depends "
 		 "on the model (default: no change from current value)");
@@ -4021,9 +4021,9 @@ struct device_attribute spic_attr_##_name = __ATTR(_name,	\
 		_mode, sony_pic_## _name ##_show,		\
 		sony_pic_## _name ##_store)
 
-static SPIC_ATTR(bluetoothpower, 0644);
-static SPIC_ATTR(wwanpower, 0644);
-static SPIC_ATTR(fanspeed, 0644);
+static SPIC_ATTR(bluetoothpower, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+static SPIC_ATTR(wwanpower, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+static SPIC_ATTR(fanspeed, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 
 static struct attribute *spic_attributes[] = {
 	&spic_attr_bluetoothpower.attr,
-- 
2.9.2

                 reply	other threads:[~2016-08-02 12:35 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=20160802115245.7052-1-baolex.ni@intel.com \
    --to=baolex.ni@intel.com \
    --cc=bhelgaas@google.com \
    --cc=chuansheng.liu@intel.com \
    --cc=dvhart@infradead.org \
    --cc=jgross@suse.com \
    --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=malattia@linux.it \
    --cc=pawel@osciak.com \
    --cc=platform-driver-x86@vger.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®