diff mbox series

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

Message ID 20180509134229.26278-3-mpe@ellerman.id.au (mailing list archive)
State Rejected
Headers show
Series [1/3] powerpc/prom: Drop support for old FDT versions | expand

Commit Message

Michael Ellerman May 9, 2018, 1:42 p.m. UTC
This is cosmetic, but the current arrangement is hell ugly, so clean
it up.

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

Patch

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))