Replace numeric parameter like 0444 with macro
PATCH 879/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]>
--- drivers/s390/char/raw3270.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/s390/char/raw3270.c +3 -3
@@ -1057,7 +1057,7 @@ raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf)return snprintf (buf,PAGE_SIZE ,"%i\n" , ((struct raw3270 *)dev_get_drvdata (dev))->model); } -static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL); +static DEVICE_ATTR(model, S_IRUSR | S_IRGRP | S_IROTH, raw3270_model_show, NULL);static ssize_t raw3270_rows_show (struct device *dev,struct device_attribute *attr,char *buf)
@@ -1065,7 +1065,7 @@ raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)return snprintf (buf,PAGE_SIZE ,"%i\n" , ((struct raw3270 *)dev_get_drvdata (dev))->rows); } -static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL); +static DEVICE_ATTR(rows, S_IRUSR | S_IRGRP | S_IROTH, raw3270_rows_show, NULL);static ssize_t raw3270_columns_show (struct device *dev,struct device_attribute *attr,char *buf)
@@ -1073,7 +1073,7 @@ raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *bureturn snprintf (buf,PAGE_SIZE ,"%i\n" , ((struct raw3270 *)dev_get_drvdata (dev))->cols); } -static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL); +static DEVICE_ATTR(columns, S_IRUSR | S_IRGRP | S_IROTH, raw3270_columns_show, NULL);static struct attribute * raw3270_attrs[] = { &dev_attr_model.attr,
Signature · 1 line
2.9.2