[PATCH 0019/1285] Replace numeric parameter like 0444 with macro

Baole Ni baolex.ni at intel.com
Tue Aug 2 20:34:45 AEST 2016


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 at intel.com>
Signed-off-by: Baole Ni <baolex.ni at intel.com>
---
 arch/powerpc/platforms/powernv/subcore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/subcore.c b/arch/powerpc/platforms/powernv/subcore.c
index 0babef1..efffe94 100644
--- a/arch/powerpc/platforms/powernv/subcore.c
+++ b/arch/powerpc/platforms/powernv/subcore.c
@@ -402,7 +402,7 @@ static ssize_t show_subcores_per_core(struct device *dev,
 	return sprintf(buf, "%x\n", subcores_per_core);
 }
 
-static DEVICE_ATTR(subcores_per_core, 0644,
+static DEVICE_ATTR(subcores_per_core, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH,
 		show_subcores_per_core, store_subcores_per_core);
 
 static int subcore_init(void)
-- 
2.9.2



More information about the Linuxppc-dev mailing list