lkml.org 
[lkml]   [2016]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 0846/1285] Replace numeric parameter like 0444 with macro
Date
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/compal-laptop.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index e1c2b6d..eaa3ecb 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -680,17 +680,17 @@ static int bat_writeable_property(struct power_supply *psy,
/* Driver Globals */
/* ============== */
static DEVICE_ATTR(wake_up_pme,
- 0644, wake_up_pme_show, wake_up_pme_store);
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wake_up_pme_show, wake_up_pme_store);
static DEVICE_ATTR(wake_up_modem,
- 0644, wake_up_modem_show, wake_up_modem_store);
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wake_up_modem_show, wake_up_modem_store);
static DEVICE_ATTR(wake_up_lan,
- 0644, wake_up_lan_show, wake_up_lan_store);
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wake_up_lan_show, wake_up_lan_store);
static DEVICE_ATTR(wake_up_wlan,
- 0644, wake_up_wlan_show, wake_up_wlan_store);
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wake_up_wlan_show, wake_up_wlan_store);
static DEVICE_ATTR(wake_up_key,
- 0644, wake_up_key_show, wake_up_key_store);
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wake_up_key_show, wake_up_key_store);
static DEVICE_ATTR(wake_up_mouse,
- 0644, wake_up_mouse_show, wake_up_mouse_store);
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, wake_up_mouse_show, wake_up_mouse_store);

static DEVICE_ATTR(fan1_input, S_IRUGO, fan_show, NULL);
static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu, NULL);
--
2.9.2
\
 
 \ /
  Last update: 2016-08-02 18:01    [W:0.039 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site