[PATCH 3/3] powerpc/prom: Clean up local variables in early_init_dt_scan_cpus()

Michael Ellerman mpe at ellerman.id.au
Wed May 9 23:42:29 AEST 2018


This is cosmetic, but the current arrangement is hell ugly, so clean
it up.

Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
---
 arch/powerpc/kernel/prom.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 9edb0d0af986..0e47fb85f47d 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -308,12 +308,11 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
 					  const char *uname, int depth,
 					  void *data)
 {
-	const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
-	const __be32 *prop;
-	const __be32 *intserv;
-	int i, nthreads;
-	int len;
-	int found = -1, found_hwid = -1;
+	int i, len, nthreads, found_hwid, found;
+	const __be32 *prop, *intserv;
+	const char *type;
+
+	type = of_get_flat_dt_prop(node, "device_type", NULL);
 
 	/* We are scanning "cpu" nodes only */
 	if (type == NULL || strcmp(type, "cpu") != 0)
@@ -330,6 +329,7 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
 	 * Now see if any of these threads match our boot cpu.
 	 * NOTE: This must match the parsing done in smp_setup_cpu_maps.
 	 */
+	found = found_hwid = -1;
 	for (i = 0; i < nthreads; i++) {
 		found_hwid = be32_to_cpu(intserv[i]);
 		if (found_hwid == fdt_boot_cpuid_phys(initial_boot_params))
-- 
2.14.1



More information about the Linuxppc-dev mailing list