* [PATCH 0881/1285] Replace numeric parameter like 0444 with macro
@ 2016-08-02 11:54 Baole Ni
0 siblings, 0 replies; only message in thread
From: Baole Ni @ 2016-08-02 11:54 UTC (permalink / raw)
To: schwidefsky, heiko.carstens, dwmw2, m.chehab, pawel,
m.szyprowski, kyungmin.park, k.kozlowski
Cc: linux-s390, linux-kernel, davem, ursula.braun, joe,
chuansheng.liu, baolex.ni
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/s390/char/vmlogrdr.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index e883063..18df533 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -535,7 +535,7 @@ static ssize_t vmlogrdr_autopurge_show(struct device *dev,
}
-static DEVICE_ATTR(autopurge, 0644, vmlogrdr_autopurge_show,
+static DEVICE_ATTR(autopurge, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, vmlogrdr_autopurge_show,
vmlogrdr_autopurge_store);
@@ -576,7 +576,7 @@ static ssize_t vmlogrdr_purge_store(struct device * dev,
}
-static DEVICE_ATTR(purge, 0200, NULL, vmlogrdr_purge_store);
+static DEVICE_ATTR(purge, S_IWUSR, NULL, vmlogrdr_purge_store);
static ssize_t vmlogrdr_autorecording_store(struct device *dev,
@@ -609,7 +609,7 @@ static ssize_t vmlogrdr_autorecording_show(struct device *dev,
}
-static DEVICE_ATTR(autorecording, 0644, vmlogrdr_autorecording_show,
+static DEVICE_ATTR(autorecording, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, vmlogrdr_autorecording_show,
vmlogrdr_autorecording_store);
@@ -638,7 +638,7 @@ static ssize_t vmlogrdr_recording_store(struct device * dev,
}
-static DEVICE_ATTR(recording, 0200, NULL, vmlogrdr_recording_store);
+static DEVICE_ATTR(recording, S_IWUSR, NULL, vmlogrdr_recording_store);
static ssize_t vmlogrdr_recording_status_show(struct device_driver *driver,
@@ -652,7 +652,7 @@ static ssize_t vmlogrdr_recording_status_show(struct device_driver *driver,
len = strlen(buf);
return len;
}
-static DRIVER_ATTR(recording_status, 0444, vmlogrdr_recording_status_show,
+static DRIVER_ATTR(recording_status, S_IRUSR | S_IRGRP | S_IROTH, vmlogrdr_recording_status_show,
NULL);
static struct attribute *vmlogrdr_drv_attrs[] = {
&driver_attr_recording_status.attr,
--
2.9.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-08-02 12:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-02 11:54 [PATCH 0881/1285] Replace numeric parameter like 0444 with macro Baole Ni
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®