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 <[email protected]>
Signed-off-by: Baole Ni <[email protected]>
---
 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

Reply via email to