]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hw/ppc/e500: Resolve variable shadowing
authorBernhard Beschow <shentey@gmail.com>
Fri, 16 Dec 2022 14:57:08 +0000 (15:57 +0100)
committerDaniel Henrique Barboza <danielhb413@gmail.com>
Wed, 21 Dec 2022 17:17:55 +0000 (14:17 -0300)
Assign to the outer variable instead which even saves some code.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20221216145709.271940-6-shentey@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
hw/ppc/e500.c

index 87439c9592d191d063f9a00873745dd2ec985ac5..da7bdb948a17c6396d3eb986eb9590cbe2aa3471 100644 (file)
@@ -908,7 +908,7 @@ void ppce500_init(MachineState *machine)
     bool kernel_as_payload;
     hwaddr bios_entry = 0;
     target_long payload_size;
-    struct boot_info *boot_info;
+    struct boot_info *boot_info = NULL;
     int dt_size;
     int i;
     unsigned int smp_cpus = machine->smp.cpus;
@@ -963,7 +963,6 @@ void ppce500_init(MachineState *machine)
         /* Register reset handler */
         if (!i) {
             /* Primary CPU */
-            struct boot_info *boot_info;
             boot_info = g_new0(struct boot_info, 1);
             qemu_register_reset(ppce500_cpu_reset, cpu);
             env->load_info = boot_info;
@@ -1262,7 +1261,6 @@ void ppce500_init(MachineState *machine)
     }
     assert(dt_size < DTB_MAX_SIZE);
 
-    boot_info = env->load_info;
     boot_info->entry = bios_entry;
     boot_info->dt_base = dt_base;
     boot_info->dt_size = dt_size;