summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell Currey <ruscur@russell.cc>2017-01-11 22:54:13 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2018-01-21 13:48:33 -0500
commit57ad583f2086d55ada284c54bfc440123cf73964 (patch)
tree5905e34d155068c69e6bfca05975b6d27f95ebce
parent600ecc1936be075f611f299755e2de90b205eb82 (diff)
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>
-rw-r--r--arch/powerpc/kernel/eeh_sysfs.c2
-rw-r--r--arch/powerpc/kernel/proc_powerpc.c2
-rw-r--r--arch/powerpc/kernel/rtas-proc.c14
-rw-r--r--arch/powerpc/kernel/rtas_flash.c2
-rw-r--r--arch/powerpc/kernel/rtasd.c2
-rw-r--r--arch/powerpc/kernel/traps.c4
-rw-r--r--arch/powerpc/kvm/book3s_hv.c10
-rw-r--r--arch/powerpc/kvm/book3s_xics.c2
-rw-r--r--arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c2
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c4
-rw-r--r--arch/powerpc/platforms/powernv/opal-dump.c4
-rw-r--r--arch/powerpc/platforms/powernv/opal-elog.c4
-rw-r--r--arch/powerpc/platforms/powernv/opal-sysparam.c6
-rw-r--r--arch/powerpc/platforms/pseries/cmm.c16
-rw-r--r--arch/powerpc/platforms/pseries/hvCall_inst.c2
-rw-r--r--arch/powerpc/platforms/pseries/ibmebus.c4
-rw-r--r--arch/powerpc/platforms/pseries/lparcfg.c4
-rw-r--r--arch/powerpc/platforms/pseries/mobility.c2
-rw-r--r--arch/powerpc/platforms/pseries/reconfig.c2
-rw-r--r--arch/powerpc/platforms/pseries/scanlog.c2
-rw-r--r--arch/powerpc/platforms/pseries/suspend.c3
-rw-r--r--arch/powerpc/sysdev/axonram.c2
-rw-r--r--arch/powerpc/sysdev/mv64x60_pci.c2
23 files changed, 47 insertions, 50 deletions
diff --git a/arch/powerpc/kernel/eeh_sysfs.c b/arch/powerpc/kernel/eeh_sysfs.c
index 797549289798..2fb6a2d09461 100644
--- a/arch/powerpc/kernel/eeh_sysfs.c
+++ b/arch/powerpc/kernel/eeh_sysfs.c
@@ -48,7 +48,7 @@ static ssize_t eeh_show_##_name(struct device *dev, \
48 \ 48 \
49 return sprintf(buf, _format "\n", edev->_memb); \ 49 return sprintf(buf, _format "\n", edev->_memb); \
50} \ 50} \
51static DEVICE_ATTR(_name, S_IRUGO, eeh_show_##_name, NULL); 51static DEVICE_ATTR(_name, 0444, eeh_show_##_name, NULL);
52 52
53EEH_SHOW_ATTR(eeh_mode, mode, "0x%x"); 53EEH_SHOW_ATTR(eeh_mode, mode, "0x%x");
54EEH_SHOW_ATTR(eeh_pe_config_addr, pe_config_addr, "0x%x"); 54EEH_SHOW_ATTR(eeh_pe_config_addr, pe_config_addr, "0x%x");
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c
index 56548bf6231f..9bfbd800d32f 100644
--- a/arch/powerpc/kernel/proc_powerpc.c
+++ b/arch/powerpc/kernel/proc_powerpc.c
@@ -63,7 +63,7 @@ static int __init proc_ppc64_init(void)
63{ 63{
64 struct proc_dir_entry *pde; 64 struct proc_dir_entry *pde;
65 65
66 pde = proc_create_data("powerpc/systemcfg", S_IFREG|S_IRUGO, NULL, 66 pde = proc_create_data("powerpc/systemcfg", S_IFREG | 0444, NULL,
67 &page_map_fops, vdso_data); 67 &page_map_fops, vdso_data);
68 if (!pde) 68 if (!pde)
69 return 1; 69 return 1;
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index c8c5f3a550c2..fb070d8cad07 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -261,19 +261,19 @@ static int __init proc_rtas_init(void)
261 if (rtas_node == NULL) 261 if (rtas_node == NULL)
262 return -ENODEV; 262 return -ENODEV;
263 263
264 proc_create("powerpc/rtas/progress", S_IRUGO|S_IWUSR, NULL, 264 proc_create("powerpc/rtas/progress", 0644, NULL,
265 &ppc_rtas_progress_operations); 265 &ppc_rtas_progress_operations);
266 proc_create("powerpc/rtas/clock", S_IRUGO|S_IWUSR, NULL, 266 proc_create("powerpc/rtas/clock", 0644, NULL,
267 &ppc_rtas_clock_operations); 267 &ppc_rtas_clock_operations);
268 proc_create("powerpc/rtas/poweron", S_IWUSR|S_IRUGO, NULL, 268 proc_create("powerpc/rtas/poweron", 0644, NULL,
269 &ppc_rtas_poweron_operations); 269 &ppc_rtas_poweron_operations);
270 proc_create("powerpc/rtas/sensors", S_IRUGO, NULL, 270 proc_create("powerpc/rtas/sensors", 0444, NULL,
271 &ppc_rtas_sensors_operations); 271 &ppc_rtas_sensors_operations);
272 proc_create("powerpc/rtas/frequency", S_IWUSR|S_IRUGO, NULL, 272 proc_create("powerpc/rtas/frequency", 0644, NULL,
273 &ppc_rtas_tone_freq_operations); 273 &ppc_rtas_tone_freq_operations);
274 proc_create("powerpc/rtas/volume", S_IWUSR|S_IRUGO, NULL, 274 proc_create("powerpc/rtas/volume", 0644, NULL,
275 &ppc_rtas_tone_volume_operations); 275 &ppc_rtas_tone_volume_operations);
276 proc_create("powerpc/rtas/rmo_buffer", S_IRUSR, NULL, 276 proc_create("powerpc/rtas/rmo_buffer", 0400, NULL,
277 &ppc_rtas_rmo_buf_ops); 277 &ppc_rtas_rmo_buf_ops);
278 return 0; 278 return 0;
279} 279}
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c
index f6f6a8a5103a..10fabae2574d 100644
--- a/arch/powerpc/kernel/rtas_flash.c
+++ b/arch/powerpc/kernel/rtas_flash.c
@@ -727,7 +727,7 @@ static int __init rtas_flash_init(void)
727 const struct rtas_flash_file *f = &rtas_flash_files[i]; 727 const struct rtas_flash_file *f = &rtas_flash_files[i];
728 int token; 728 int token;
729 729
730 if (!proc_create(f->filename, S_IRUSR | S_IWUSR, NULL, &f->fops)) 730 if (!proc_create(f->filename, 0600, NULL, &f->fops))
731 goto enomem; 731 goto enomem;
732 732
733 /* 733 /*
diff --git a/arch/powerpc/kernel/rtasd.c b/arch/powerpc/kernel/rtasd.c
index 0f0b1b2f3b60..7ae4b8ba7fd3 100644
--- a/arch/powerpc/kernel/rtasd.c
+++ b/arch/powerpc/kernel/rtasd.c
@@ -581,7 +581,7 @@ static int __init rtas_init(void)
581 if (!rtas_log_buf) 581 if (!rtas_log_buf)
582 return -ENODEV; 582 return -ENODEV;
583 583
584 entry = proc_create("powerpc/rtas/error_log", S_IRUSR, NULL, 584 entry = proc_create("powerpc/rtas/error_log", 0400, NULL,
585 &proc_rtas_log_operations); 585 &proc_rtas_log_operations);
586 if (!entry) 586 if (!entry)
587 printk(KERN_ERR "Failed to create error_log proc entry\n"); 587 printk(KERN_ERR "Failed to create error_log proc entry\n");
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 122a3c883f4e..cb07d6519783 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -2130,13 +2130,13 @@ static int __init ppc_warn_emulated_init(void)
2130 if (!dir) 2130 if (!dir)
2131 return -ENOMEM; 2131 return -ENOMEM;
2132 2132
2133 d = debugfs_create_u32("do_warn", S_IRUGO | S_IWUSR, dir, 2133 d = debugfs_create_u32("do_warn", 0644, dir,
2134 &ppc_warn_emulated); 2134 &ppc_warn_emulated);
2135 if (!d) 2135 if (!d)
2136 goto fail; 2136 goto fail;
2137 2137
2138 for (i = 0; i < sizeof(ppc_emulated)/sizeof(*entries); i++) { 2138 for (i = 0; i < sizeof(ppc_emulated)/sizeof(*entries); i++) {
2139 d = debugfs_create_u32(entries[i].name, S_IRUGO | S_IWUSR, dir, 2139 d = debugfs_create_u32(entries[i].name, 0644, dir,
2140 (u32 *)&entries[i].val.counter); 2140 (u32 *)&entries[i].val.counter);
2141 if (!d) 2141 if (!d)
2142 goto fail; 2142 goto fail;
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 2d46037ce936..e4f70c33fbc7 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -93,10 +93,10 @@
93static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1); 93static DECLARE_BITMAP(default_enabled_hcalls, MAX_HCALL_OPCODE/4 + 1);
94 94
95static int dynamic_mt_modes = 6; 95static int dynamic_mt_modes = 6;
96module_param(dynamic_mt_modes, int, S_IRUGO | S_IWUSR); 96module_param(dynamic_mt_modes, int, 0644);
97MODULE_PARM_DESC(dynamic_mt_modes, "Set of allowed dynamic micro-threading modes: 0 (= none), 2, 4, or 6 (= 2 or 4)"); 97MODULE_PARM_DESC(dynamic_mt_modes, "Set of allowed dynamic micro-threading modes: 0 (= none), 2, 4, or 6 (= 2 or 4)");
98static int target_smt_mode; 98static int target_smt_mode;
99module_param(target_smt_mode, int, S_IRUGO | S_IWUSR); 99module_param(target_smt_mode, int, 0644);
100MODULE_PARM_DESC(target_smt_mode, "Target threads per core (0 = max)"); 100MODULE_PARM_DESC(target_smt_mode, "Target threads per core (0 = max)");
101 101
102static bool indep_threads_mode = true; 102static bool indep_threads_mode = true;
@@ -109,12 +109,10 @@ static struct kernel_param_ops module_param_ops = {
109 .get = param_get_int, 109 .get = param_get_int,
110}; 110};
111 111
112module_param_cb(kvm_irq_bypass, &module_param_ops, &kvm_irq_bypass, 112module_param_cb(kvm_irq_bypass, &module_param_ops, &kvm_irq_bypass, 0644);
113 S_IRUGO | S_IWUSR);
114MODULE_PARM_DESC(kvm_irq_bypass, "Bypass passthrough interrupt optimization"); 113MODULE_PARM_DESC(kvm_irq_bypass, "Bypass passthrough interrupt optimization");
115 114
116module_param_cb(h_ipi_redirect, &module_param_ops, &h_ipi_redirect, 115module_param_cb(h_ipi_redirect, &module_param_ops, &h_ipi_redirect, 0644);
117 S_IRUGO | S_IWUSR);
118MODULE_PARM_DESC(h_ipi_redirect, "Redirect H_IPI wakeup to a free host core"); 116MODULE_PARM_DESC(h_ipi_redirect, "Redirect H_IPI wakeup to a free host core");
119#endif 117#endif
120 118
diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c
index d329b2add7e2..b8356cdc0c04 100644
--- a/arch/powerpc/kvm/book3s_xics.c
+++ b/arch/powerpc/kvm/book3s_xics.c
@@ -1039,7 +1039,7 @@ static void xics_debugfs_init(struct kvmppc_xics *xics)
1039 return; 1039 return;
1040 } 1040 }
1041 1041
1042 xics->dentry = debugfs_create_file(name, S_IRUGO, powerpc_debugfs_root, 1042 xics->dentry = debugfs_create_file(name, 0444, powerpc_debugfs_root,
1043 xics, &xics_debug_fops); 1043 xics, &xics_debug_fops);
1044 1044
1045 pr_debug("%s: created %s\n", __func__, name); 1045 pr_debug("%s: created %s\n", __func__, name);
diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 96bb55ca61d3..d2ef39f0edc8 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -84,7 +84,7 @@ static ssize_t show_status(struct device *d,
84 84
85 return sprintf(buf, "%02x\n", ret); 85 return sprintf(buf, "%02x\n", ret);
86} 86}
87static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); 87static DEVICE_ATTR(status, 0444, show_status, NULL);
88 88
89static void mcu_power_off(void) 89static void mcu_power_off(void)
90{ 90{
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 9558d725a99b..db329d4bf1c3 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -455,7 +455,7 @@ spufs_create_context(struct inode *inode, struct dentry *dentry,
455 } 455 }
456 } 456 }
457 457
458 ret = spufs_mkdir(inode, dentry, flags, mode & S_IRWXUGO); 458 ret = spufs_mkdir(inode, dentry, flags, mode & 0777);
459 if (ret) 459 if (ret)
460 goto out_aff_unlock; 460 goto out_aff_unlock;
461 461
@@ -546,7 +546,7 @@ static int spufs_create_gang(struct inode *inode,
546 struct path path = {.mnt = mnt, .dentry = dentry}; 546 struct path path = {.mnt = mnt, .dentry = dentry};
547 int ret; 547 int ret;
548 548
549 ret = spufs_mkgang(inode, dentry, mode & S_IRWXUGO); 549 ret = spufs_mkgang(inode, dentry, mode & 0777);
550 if (!ret) { 550 if (!ret) {
551 ret = spufs_gang_open(&path); 551 ret = spufs_gang_open(&path);
552 if (ret < 0) { 552 if (ret < 0) {
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 4c827826c05e..0dc8fa4e0af2 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -103,9 +103,9 @@ static ssize_t dump_ack_store(struct dump_obj *dump_obj,
103 * due to the dynamic size of the dump 103 * due to the dynamic size of the dump
104 */ 104 */
105static struct dump_attribute id_attribute = 105static struct dump_attribute id_attribute =
106 __ATTR(id, S_IRUGO, dump_id_show, NULL); 106 __ATTR(id, 0444, dump_id_show, NULL);
107static struct dump_attribute type_attribute = 107static struct dump_attribute type_attribute =
108 __ATTR(type, S_IRUGO, dump_type_show, NULL); 108 __ATTR(type, 0444, dump_type_show, NULL);
109static struct dump_attribute ack_attribute = 109static struct dump_attribute ack_attribute =
110 __ATTR(acknowledge, 0660, dump_ack_show, dump_ack_store); 110 __ATTR(acknowledge, 0660, dump_ack_show, dump_ack_store);
111 111
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index ecd6d9177d13..ba6e437abb4b 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -83,9 +83,9 @@ static ssize_t elog_ack_store(struct elog_obj *elog_obj,
83} 83}
84 84
85static struct elog_attribute id_attribute = 85static struct elog_attribute id_attribute =
86 __ATTR(id, S_IRUGO, elog_id_show, NULL); 86 __ATTR(id, 0444, elog_id_show, NULL);
87static struct elog_attribute type_attribute = 87static struct elog_attribute type_attribute =
88 __ATTR(type, S_IRUGO, elog_type_show, NULL); 88 __ATTR(type, 0444, elog_type_show, NULL);
89static struct elog_attribute ack_attribute = 89static struct elog_attribute ack_attribute =
90 __ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store); 90 __ATTR(acknowledge, 0660, elog_ack_show, elog_ack_store);
91 91
diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c
index 23fb6647dced..6fd4092798d5 100644
--- a/arch/powerpc/platforms/powernv/opal-sysparam.c
+++ b/arch/powerpc/platforms/powernv/opal-sysparam.c
@@ -260,13 +260,13 @@ void __init opal_sys_param_init(void)
260 /* If the parameter is read-only or read-write */ 260 /* If the parameter is read-only or read-write */
261 switch (perm[i] & 3) { 261 switch (perm[i] & 3) {
262 case OPAL_SYSPARAM_READ: 262 case OPAL_SYSPARAM_READ:
263 attr[i].kobj_attr.attr.mode = S_IRUGO; 263 attr[i].kobj_attr.attr.mode = 0444;
264 break; 264 break;
265 case OPAL_SYSPARAM_WRITE: 265 case OPAL_SYSPARAM_WRITE:
266 attr[i].kobj_attr.attr.mode = S_IWUSR; 266 attr[i].kobj_attr.attr.mode = 0200;
267 break; 267 break;
268 case OPAL_SYSPARAM_RW: 268 case OPAL_SYSPARAM_RW:
269 attr[i].kobj_attr.attr.mode = S_IRUGO | S_IWUSR; 269 attr[i].kobj_attr.attr.mode = 0644;
270 break; 270 break;
271 default: 271 default:
272 break; 272 break;
diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c
index 560aefde06c0..25427a48feae 100644
--- a/arch/powerpc/platforms/pseries/cmm.c
+++ b/arch/powerpc/platforms/pseries/cmm.c
@@ -72,20 +72,20 @@ MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager");
72MODULE_LICENSE("GPL"); 72MODULE_LICENSE("GPL");
73MODULE_VERSION(CMM_DRIVER_VERSION); 73MODULE_VERSION(CMM_DRIVER_VERSION);
74 74
75module_param_named(delay, delay, uint, S_IRUGO | S_IWUSR); 75module_param_named(delay, delay, uint, 0644);
76MODULE_PARM_DESC(delay, "Delay (in seconds) between polls to query hypervisor paging requests. " 76MODULE_PARM_DESC(delay, "Delay (in seconds) between polls to query hypervisor paging requests. "
77 "[Default=" __stringify(CMM_DEFAULT_DELAY) "]"); 77 "[Default=" __stringify(CMM_DEFAULT_DELAY) "]");
78module_param_named(hotplug_delay, hotplug_delay, uint, S_IRUGO | S_IWUSR); 78module_param_named(hotplug_delay, hotplug_delay, uint, 0644);
79MODULE_PARM_DESC(hotplug_delay, "Delay (in seconds) after memory hotplug remove " 79MODULE_PARM_DESC(hotplug_delay, "Delay (in seconds) after memory hotplug remove "
80 "before loaning resumes. " 80 "before loaning resumes. "
81 "[Default=" __stringify(CMM_HOTPLUG_DELAY) "]"); 81 "[Default=" __stringify(CMM_HOTPLUG_DELAY) "]");
82module_param_named(oom_kb, oom_kb, uint, S_IRUGO | S_IWUSR); 82module_param_named(oom_kb, oom_kb, uint, 0644);
83MODULE_PARM_DESC(oom_kb, "Amount of memory in kb to free on OOM. " 83MODULE_PARM_DESC(oom_kb, "Amount of memory in kb to free on OOM. "
84 "[Default=" __stringify(CMM_OOM_KB) "]"); 84 "[Default=" __stringify(CMM_OOM_KB) "]");
85module_param_named(min_mem_mb, min_mem_mb, ulong, S_IRUGO | S_IWUSR); 85module_param_named(min_mem_mb, min_mem_mb, ulong, 0644);
86MODULE_PARM_DESC(min_mem_mb, "Minimum amount of memory (in MB) to not balloon. " 86MODULE_PARM_DESC(min_mem_mb, "Minimum amount of memory (in MB) to not balloon. "
87 "[Default=" __stringify(CMM_MIN_MEM_MB) "]"); 87 "[Default=" __stringify(CMM_MIN_MEM_MB) "]");
88module_param_named(debug, cmm_debug, uint, S_IRUGO | S_IWUSR); 88module_param_named(debug, cmm_debug, uint, 0644);
89MODULE_PARM_DESC(debug, "Enable module debugging logging. Set to 1 to enable. " 89MODULE_PARM_DESC(debug, "Enable module debugging logging. Set to 1 to enable. "
90 "[Default=" __stringify(CMM_DEBUG) "]"); 90 "[Default=" __stringify(CMM_DEBUG) "]");
91 91
@@ -385,7 +385,7 @@ static int cmm_thread(void *dummy)
385 { \ 385 { \
386 return sprintf(buf, format, ##args); \ 386 return sprintf(buf, format, ##args); \
387 } \ 387 } \
388 static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL) 388 static DEVICE_ATTR(name, 0444, show_##name, NULL)
389 389
390CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages)); 390CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages));
391CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target)); 391CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target));
@@ -411,7 +411,7 @@ static ssize_t store_oom_pages(struct device *dev,
411 return count; 411 return count;
412} 412}
413 413
414static DEVICE_ATTR(oom_freed_kb, S_IWUSR | S_IRUGO, 414static DEVICE_ATTR(oom_freed_kb, 0644,
415 show_oom_pages, store_oom_pages); 415 show_oom_pages, store_oom_pages);
416 416
417static struct device_attribute *cmm_attrs[] = { 417static struct device_attribute *cmm_attrs[] = {
@@ -765,7 +765,7 @@ static int cmm_set_disable(const char *val, const struct kernel_param *kp)
765} 765}
766 766
767module_param_call(disable, cmm_set_disable, param_get_uint, 767module_param_call(disable, cmm_set_disable, param_get_uint,
768 &cmm_disabled, S_IRUGO | S_IWUSR); 768 &cmm_disabled, 0644);
769MODULE_PARM_DESC(disable, "Disable CMM. Set to 1 to disable. " 769MODULE_PARM_DESC(disable, "Disable CMM. Set to 1 to disable. "
770 "[Default=" __stringify(CMM_DISABLE) "]"); 770 "[Default=" __stringify(CMM_DISABLE) "]");
771 771
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c
index 957ae347b0b3..89b7ce807e70 100644
--- a/arch/powerpc/platforms/pseries/hvCall_inst.c
+++ b/arch/powerpc/platforms/pseries/hvCall_inst.c
@@ -163,7 +163,7 @@ static int __init hcall_inst_init(void)
163 163
164 for_each_possible_cpu(cpu) { 164 for_each_possible_cpu(cpu) {
165 snprintf(cpu_name_buf, CPU_NAME_BUF_SIZE, "cpu%d", cpu); 165 snprintf(cpu_name_buf, CPU_NAME_BUF_SIZE, "cpu%d", cpu);
166 hcall_file = debugfs_create_file(cpu_name_buf, S_IRUGO, 166 hcall_file = debugfs_create_file(cpu_name_buf, 0444,
167 hcall_root, 167 hcall_root,
168 per_cpu(hcall_stats, cpu), 168 per_cpu(hcall_stats, cpu),
169 &hcall_inst_seq_fops); 169 &hcall_inst_seq_fops);
diff --git a/arch/powerpc/platforms/pseries/ibmebus.c b/arch/powerpc/platforms/pseries/ibmebus.c
index 408a86044133..c7c1140c13b6 100644
--- a/arch/powerpc/platforms/pseries/ibmebus.c
+++ b/arch/powerpc/platforms/pseries/ibmebus.c
@@ -298,7 +298,7 @@ out:
298 return rc; 298 return rc;
299 return count; 299 return count;
300} 300}
301static BUS_ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe); 301static BUS_ATTR(probe, 0200, NULL, ibmebus_store_probe);
302 302
303static ssize_t ibmebus_store_remove(struct bus_type *bus, 303static ssize_t ibmebus_store_remove(struct bus_type *bus,
304 const char *buf, size_t count) 304 const char *buf, size_t count)
@@ -325,7 +325,7 @@ static ssize_t ibmebus_store_remove(struct bus_type *bus,
325 return -ENODEV; 325 return -ENODEV;
326 } 326 }
327} 327}
328static BUS_ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove); 328static BUS_ATTR(remove, 0200, NULL, ibmebus_store_remove);
329 329
330static struct attribute *ibmbus_bus_attrs[] = { 330static struct attribute *ibmbus_bus_attrs[] = {
331 &bus_attr_probe.attr, 331 &bus_attr_probe.attr,
diff --git a/arch/powerpc/platforms/pseries/lparcfg.c b/arch/powerpc/platforms/pseries/lparcfg.c
index f43eafe30c7f..c508c938dc71 100644
--- a/arch/powerpc/platforms/pseries/lparcfg.c
+++ b/arch/powerpc/platforms/pseries/lparcfg.c
@@ -697,11 +697,11 @@ static const struct file_operations lparcfg_fops = {
697 697
698static int __init lparcfg_init(void) 698static int __init lparcfg_init(void)
699{ 699{
700 umode_t mode = S_IRUSR | S_IRGRP | S_IROTH; 700 umode_t mode = 0444;
701 701
702 /* Allow writing if we have FW_FEATURE_SPLPAR */ 702 /* Allow writing if we have FW_FEATURE_SPLPAR */
703 if (firmware_has_feature(FW_FEATURE_SPLPAR)) 703 if (firmware_has_feature(FW_FEATURE_SPLPAR))
704 mode |= S_IWUSR; 704 mode |= 0200;
705 705
706 if (!proc_create("powerpc/lparcfg", mode, NULL, &lparcfg_fops)) { 706 if (!proc_create("powerpc/lparcfg", mode, NULL, &lparcfg_fops)) {
707 printk(KERN_ERR "Failed to create powerpc/lparcfg\n"); 707 printk(KERN_ERR "Failed to create powerpc/lparcfg\n");
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index f7042ad492ba..0f7fb7170b03 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -384,7 +384,7 @@ static ssize_t migration_store(struct class *class,
384#define MIGRATION_API_VERSION 1 384#define MIGRATION_API_VERSION 1
385 385
386static CLASS_ATTR_WO(migration); 386static CLASS_ATTR_WO(migration);
387static CLASS_ATTR_STRING(api_version, S_IRUGO, __stringify(MIGRATION_API_VERSION)); 387static CLASS_ATTR_STRING(api_version, 0444, __stringify(MIGRATION_API_VERSION));
388 388
389static int __init mobility_sysfs_init(void) 389static int __init mobility_sysfs_init(void)
390{ 390{
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index f24d8159c9e1..0e0208117e77 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -405,7 +405,7 @@ static int proc_ppc64_create_ofdt(void)
405{ 405{
406 struct proc_dir_entry *ent; 406 struct proc_dir_entry *ent;
407 407
408 ent = proc_create("powerpc/ofdt", S_IWUSR, NULL, &ofdt_fops); 408 ent = proc_create("powerpc/ofdt", 0200, NULL, &ofdt_fops);
409 if (ent) 409 if (ent)
410 proc_set_size(ent, 0); 410 proc_set_size(ent, 0);
411 411
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c
index c47585a78b69..054ce7a16fc3 100644
--- a/arch/powerpc/platforms/pseries/scanlog.c
+++ b/arch/powerpc/platforms/pseries/scanlog.c
@@ -179,7 +179,7 @@ static int __init scanlog_init(void)
179 if (!scanlog_buffer) 179 if (!scanlog_buffer)
180 goto err; 180 goto err;
181 181
182 ent = proc_create("powerpc/rtas/scan-log-dump", S_IRUSR, NULL, 182 ent = proc_create("powerpc/rtas/scan-log-dump", 0400, NULL,
183 &scanlog_fops); 183 &scanlog_fops);
184 if (!ent) 184 if (!ent)
185 goto err; 185 goto err;
diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
index 89726f07d249..52a021e1f86b 100644
--- a/arch/powerpc/platforms/pseries/suspend.c
+++ b/arch/powerpc/platforms/pseries/suspend.c
@@ -214,8 +214,7 @@ static ssize_t show_hibernate(struct device *dev,
214 return sprintf(buf, "%d\n", KERN_DT_UPDATE); 214 return sprintf(buf, "%d\n", KERN_DT_UPDATE);
215} 215}
216 216
217static DEVICE_ATTR(hibernate, S_IWUSR | S_IRUGO, 217static DEVICE_ATTR(hibernate, 0644, show_hibernate, store_hibernate);
218 show_hibernate, store_hibernate);
219 218
220static struct bus_type suspend_subsys = { 219static struct bus_type suspend_subsys = {
221 .name = "power", 220 .name = "power",
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)
83 return sprintf(buf, "%ld\n", bank->ecc_counter); 83 return sprintf(buf, "%ld\n", bank->ecc_counter);
84} 84}
85 85
86static DEVICE_ATTR(ecc, S_IRUGO, axon_ram_sysfs_ecc, NULL); 86static DEVICE_ATTR(ecc, 0444, axon_ram_sysfs_ecc, NULL);
87 87
88/** 88/**
89 * axon_ram_irq_handler - interrupt handler for Axon RAM ECC 89 * 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,
73static const struct bin_attribute mv64x60_hs_reg_attr = { /* Hotswap register */ 73static const struct bin_attribute mv64x60_hs_reg_attr = { /* Hotswap register */
74 .attr = { 74 .attr = {
75 .name = "hs_reg", 75 .name = "hs_reg",
76 .mode = S_IRUGO | S_IWUSR, 76 .mode = 0644,
77 }, 77 },
78 .size = MV64X60_VAL_LEN_MAX, 78 .size = MV64X60_VAL_LEN_MAX,
79 .read = mv64x60_hs_reg_read, 79 .read = mv64x60_hs_reg_read,