summaryrefslogtreecommitdiff
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2017-01-12 06:54:13 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-21 21:48:33 +0300
commit57ad583f2086d55ada284c54bfc440123cf73964 (patch)
tree5905e34d155068c69e6bfca05975b6d27f95ebce /arch/powerpc/sysdev
parent600ecc1936be075f611f299755e2de90b205eb82 (diff)
downloadlinux-57ad583f2086d55ada284c54bfc440123cf73964.tar.xz
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>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/axonram.c2
-rw-r--r--arch/powerpc/sysdev/mv64x60_pci.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index 1b307c80b401..53b7f8ef570f 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -83,7 +83,7 @@ axon_ram_sysfs_ecc(struct device *dev, struct device_attribute *attr, char *buf)
return sprintf(buf, "%ld\n", bank->ecc_counter);
}
-static DEVICE_ATTR(ecc, S_IRUGO, axon_ram_sysfs_ecc, NULL);
+static DEVICE_ATTR(ecc, 0444, axon_ram_sysfs_ecc, NULL);
/**
* axon_ram_irq_handler - interrupt handler for Axon RAM ECC
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index d52b3b81e05f..50c411b1761e 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -73,7 +73,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
static const struct bin_attribute mv64x60_hs_reg_attr = { /* Hotswap register */
.attr = {
.name = "hs_reg",
- .mode = S_IRUGO | S_IWUSR,
+ .mode = 0644,
},
.size = MV64X60_VAL_LEN_MAX,
.read = mv64x60_hs_reg_read,