diff mbox

[0999/1285] Replace numeric parameter like 0444 with macro

Message ID 20160802120645.16675-1-baolex.ni@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

baolex.ni Aug. 2, 2016, 12:06 p.m. UTC
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/video/fbdev/auo_k190x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
index 9580374..7e62a38 100644
--- a/drivers/video/fbdev/auo_k190x.c
+++ b/drivers/video/fbdev/auo_k190x.c
@@ -707,9 +707,9 @@  static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
 	return sprintf(buf, "%d\n", temp);
 }
 
-static DEVICE_ATTR(update_mode, 0644, update_mode_show, update_mode_store);
-static DEVICE_ATTR(flash, 0644, flash_show, flash_store);
-static DEVICE_ATTR(temp, 0644, temp_show, NULL);
+static DEVICE_ATTR(update_mode, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, update_mode_show, update_mode_store);
+static DEVICE_ATTR(flash, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, flash_show, flash_store);
+static DEVICE_ATTR(temp, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, temp_show, NULL);
 
 static struct attribute *auok190x_attributes[] = {
 	&dev_attr_update_mode.attr,