[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20160802120322.14393-1-baolex.ni@intel.com>
Date: Tue, 2 Aug 2016 20:03:22 +0800
From: Baole Ni <baolex.ni@...el.com>
To: gregkh@...uxfoundation.org, jslaby@...e.com, m.chehab@...sung.com,
m.szyprowski@...sung.com, kyungmin.park@...sung.com,
k.kozlowski@...sung.com
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
davem@...emloft.net, ursula.braun@...ibm.com,
chuansheng.liu@...el.com, baolex.ni@...el.com
Subject: [PATCH 0965/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/tty/hvc/hvc_iucv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
index 8b70a16..9234097 100644
--- a/drivers/tty/hvc/hvc_iucv.c
+++ b/drivers/tty/hvc/hvc_iucv.c
@@ -1065,9 +1065,9 @@ static struct device_driver hvc_iucv_driver = {
};
/* IUCV HVC device attributes */
-static DEVICE_ATTR(termid, 0640, hvc_iucv_dev_termid_show, NULL);
-static DEVICE_ATTR(state, 0640, hvc_iucv_dev_state_show, NULL);
-static DEVICE_ATTR(peer, 0640, hvc_iucv_dev_peer_show, NULL);
+static DEVICE_ATTR(termid, S_IRUSR | S_IWUSR | S_IRGRP, hvc_iucv_dev_termid_show, NULL);
+static DEVICE_ATTR(state, S_IRUSR | S_IWUSR | S_IRGRP, hvc_iucv_dev_state_show, NULL);
+static DEVICE_ATTR(peer, S_IRUSR | S_IWUSR | S_IRGRP, hvc_iucv_dev_peer_show, NULL);
static struct attribute *hvc_iucv_dev_attrs[] = {
&dev_attr_termid.attr,
&dev_attr_state.attr,
@@ -1475,4 +1475,4 @@ static int __init hvc_iucv_config(char *val)
device_initcall(hvc_iucv_init);
__setup("hvc_iucv=", hvc_iucv_config);
-core_param(hvc_iucv_allow, hvc_iucv_filter, vmidfilter, 0640);
+core_param(hvc_iucv_allow, hvc_iucv_filter, vmidfilter, S_IRUSR | S_IWUSR | S_IRGRP);
--
2.9.2
Powered by blists - more mailing lists