Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57ad583f authored by Russell Currey's avatar Russell Currey Committed by Michael Ellerman
Browse files

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: default avatarRussell Currey <ruscur@russell.cc>
Reviewed-by: default avatarCyril Bur <cyrilbur@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 600ecc19
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ static ssize_t eeh_show_##_name(struct device *dev, \
	                                                      \
	return sprintf(buf, _format "\n", edev->_memb);       \
}                                                        \
static DEVICE_ATTR(_name, S_IRUGO, eeh_show_##_name, NULL);
static DEVICE_ATTR(_name, 0444, eeh_show_##_name, NULL);

EEH_SHOW_ATTR(eeh_mode,            mode,            "0x%x");
EEH_SHOW_ATTR(eeh_pe_config_addr,  pe_config_addr,  "0x%x");
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ static int __init proc_ppc64_init(void)
{
	struct proc_dir_entry *pde;

	pde = proc_create_data("powerpc/systemcfg", S_IFREG|S_IRUGO, NULL,
	pde = proc_create_data("powerpc/systemcfg", S_IFREG | 0444, NULL,
			       &page_map_fops, vdso_data);
	if (!pde)
		return 1;
+7 −7
Original line number Diff line number Diff line
@@ -261,19 +261,19 @@ static int __init proc_rtas_init(void)
	if (rtas_node == NULL)
		return -ENODEV;

	proc_create("powerpc/rtas/progress", S_IRUGO|S_IWUSR, NULL,
	proc_create("powerpc/rtas/progress", 0644, NULL,
		    &ppc_rtas_progress_operations);
	proc_create("powerpc/rtas/clock", S_IRUGO|S_IWUSR, NULL,
	proc_create("powerpc/rtas/clock", 0644, NULL,
		    &ppc_rtas_clock_operations);
	proc_create("powerpc/rtas/poweron", S_IWUSR|S_IRUGO, NULL,
	proc_create("powerpc/rtas/poweron", 0644, NULL,
		    &ppc_rtas_poweron_operations);
	proc_create("powerpc/rtas/sensors", S_IRUGO, NULL,
	proc_create("powerpc/rtas/sensors", 0444, NULL,
		    &ppc_rtas_sensors_operations);
	proc_create("powerpc/rtas/frequency", S_IWUSR|S_IRUGO, NULL,
	proc_create("powerpc/rtas/frequency", 0644, NULL,
		    &ppc_rtas_tone_freq_operations);
	proc_create("powerpc/rtas/volume", S_IWUSR|S_IRUGO, NULL,
	proc_create("powerpc/rtas/volume", 0644, NULL,
		    &ppc_rtas_tone_volume_operations);
	proc_create("powerpc/rtas/rmo_buffer", S_IRUSR, NULL,
	proc_create("powerpc/rtas/rmo_buffer", 0400, NULL,
		    &ppc_rtas_rmo_buf_ops);
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -727,7 +727,7 @@ static int __init rtas_flash_init(void)
		const struct rtas_flash_file *f = &rtas_flash_files[i];
		int token;

		if (!proc_create(f->filename, S_IRUSR | S_IWUSR, NULL, &f->fops))
		if (!proc_create(f->filename, 0600, NULL, &f->fops))
			goto enomem;

		/*
+1 −1
Original line number Diff line number Diff line
@@ -581,7 +581,7 @@ static int __init rtas_init(void)
	if (!rtas_log_buf)
		return -ENODEV;

	entry = proc_create("powerpc/rtas/error_log", S_IRUSR, NULL,
	entry = proc_create("powerpc/rtas/error_log", 0400, NULL,
			    &proc_rtas_log_operations);
	if (!entry)
		printk(KERN_ERR "Failed to create error_log proc entry\n");
Loading