[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/6] hw/ppc/e500: Resolve variable shadowing
From: |
Bernhard Beschow |
Subject: |
[PATCH 5/6] hw/ppc/e500: Resolve variable shadowing |
Date: |
Fri, 16 Dec 2022 15:57:08 +0100 |
Assign to the outer variable instead which even saves some code.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/ppc/e500.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index ad83924004..104a85ad22 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -883,7 +883,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;
@@ -938,7 +938,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;
@@ -1217,7 +1216,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;
--
2.39.0
- [PATCH 0/6] Trivial PPC cleanups, Bernhard Beschow, 2022/12/16
- [PATCH 1/6] target/ppc/mmu_common: Log which effective address had no TLB entry found, Bernhard Beschow, 2022/12/16
- [PATCH 5/6] hw/ppc/e500: Resolve variable shadowing,
Bernhard Beschow <=
- [PATCH 3/6] hw/ppc/virtex_ml507: Prefer local over global variable, Bernhard Beschow, 2022/12/16
- [PATCH 6/6] hw/ppc/e500: Move comment to more appropriate place, Bernhard Beschow, 2022/12/16
- [PATCH 2/6] target/ppc/mmu_common: Fix table layout of "info tlb" HMP command, Bernhard Beschow, 2022/12/16
- [PATCH 4/6] hw/ppc/e500: Prefer local variable over qdev_get_machine(), Bernhard Beschow, 2022/12/16
- Re: [PATCH 0/6] Trivial PPC cleanups, Cédric Le Goater, 2022/12/16