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/regulator/virtual.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c
index a6f1c7a..0084a1e 100644
--- a/drivers/regulator/virtual.c
+++ b/drivers/regulator/virtual.c
@@ -266,11 +266,11 @@ static ssize_t set_mode(struct device *dev, struct 
device_attribute *attr,
        return count;
 }
 
-static DEVICE_ATTR(min_microvolts, 0664, show_min_uV, set_min_uV);
-static DEVICE_ATTR(max_microvolts, 0664, show_max_uV, set_max_uV);
-static DEVICE_ATTR(min_microamps, 0664, show_min_uA, set_min_uA);
-static DEVICE_ATTR(max_microamps, 0664, show_max_uA, set_max_uA);
-static DEVICE_ATTR(mode, 0664, show_mode, set_mode);
+static DEVICE_ATTR(min_microvolts, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 
S_IROTH, show_min_uV, set_min_uV);
+static DEVICE_ATTR(max_microvolts, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 
S_IROTH, show_max_uV, set_max_uV);
+static DEVICE_ATTR(min_microamps, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 
S_IROTH, show_min_uA, set_min_uA);
+static DEVICE_ATTR(max_microamps, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | 
S_IROTH, show_max_uA, set_max_uA);
+static DEVICE_ATTR(mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH, 
show_mode, set_mode);
 
 static struct attribute *regulator_virtual_attributes[] = {
        &dev_attr_min_microvolts.attr,
-- 
2.9.2

Reply via email to