Replace numeric parameter like 0444 with macro
Subsystems (2)
PATCH 1041/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 <[email protected]>
Signed-off-by Baole Ni <[email protected]>
--- fs/fuse/cuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/fuse/cuse.c +2 -2
@@ -573,7 +573,7 @@ static ssize_t cuse_class_waiting_show(struct device *dev,return sprintf (buf,"%d\n" ,atomic_read (&cc->fc.num_waiting)); } -static DEVICE_ATTR(waiting, 0400, cuse_class_waiting_show, NULL); +static DEVICE_ATTR(waiting, S_IRUSR, cuse_class_waiting_show, NULL); static ssize_t cuse_class_abort_store(struct device *dev, struct device_attribute *attr,
@@ -584,7 +584,7 @@ static ssize_t cuse_class_abort_store(struct device *dev,fuse_abort_conn (&cc->fc);return count; } -static DEVICE_ATTR(abort, 0200, NULL, cuse_class_abort_store); +static DEVICE_ATTR(abort, S_IWUSR, NULL, cuse_class_abort_store);static struct attribute *cuse_class_dev_attrs[] = { &dev_attr_waiting.attr,
Signature · 1 line
2.9.2