Skip to contentSkip to conversation

Replace numeric parameter like 0444 with macro

PATCH NAK Baole Ni 1 participant 1 message Aug 2, 2016 Multifunction devices (MFD)

lore
Share & tools
lore

Baole Ni

author
#0 lore raw

PATCH 676/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.

---
 drivers/mfd/pcf50633-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/pcf50633-core.c +2 -2
index 6155d12..37f41c5 100644
@@ -111,7 +111,7 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr,
 
 	return buf1 - buf;
 }
-static DEVICE_ATTR(dump_regs, 0400, show_dump_regs, NULL);
+static DEVICE_ATTR(dump_regs, S_IRUSR, show_dump_regs, NULL);
 
 static ssize_t show_resume_reason(struct device *dev,
 				struct device_attribute *attr, char *buf)
@@ -128,7 +128,7 @@ static ssize_t show_resume_reason(struct device *dev,
 
 	return n;
 }
-static DEVICE_ATTR(resume_reason, 0400, show_resume_reason, NULL);
+static DEVICE_ATTR(resume_reason, S_IRUSR, show_resume_reason, NULL);
 
 static struct attribute *pcf_sysfs_entries[] = {
 	&dev_attr_dump_regs.attr,
Signature · 1 line
2.9.2