powerpc: Use octal numbers for file permissions
Symbolic macros are unintuitive and hard to read, whereas octal constants are much easier to interpret. Replace macros for the basic permission flags (user/group/other read/write/execute) with numeric constants instead, across the whole powerpc tree. Introducing a significant number of changes across the tree for no runtime benefit isn't exactly desirable, but so long as these macros are still used in the tree people will keep sending patches that add them. Not only are they hard to parse at a glance, there are multiple ways of coming to the same value (as you can see with 0444 and 0644 in this patch) which hurts readability. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:

committed by
Michael Ellerman

parent
600ecc1936
commit
57ad583f20
@@ -260,13 +260,13 @@ void __init opal_sys_param_init(void)
|
||||
/* If the parameter is read-only or read-write */
|
||||
switch (perm[i] & 3) {
|
||||
case OPAL_SYSPARAM_READ:
|
||||
attr[i].kobj_attr.attr.mode = S_IRUGO;
|
||||
attr[i].kobj_attr.attr.mode = 0444;
|
||||
break;
|
||||
case OPAL_SYSPARAM_WRITE:
|
||||
attr[i].kobj_attr.attr.mode = S_IWUSR;
|
||||
attr[i].kobj_attr.attr.mode = 0200;
|
||||
break;
|
||||
case OPAL_SYSPARAM_RW:
|
||||
attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUSR;
|
||||
attr[i].kobj_attr.attr.mode = 0644;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Reference in New Issue
Block a user