[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 02/26] hw/ppc/e500: Remove firstenv variable
From: |
Bernhard Beschow |
Subject: |
[PATCH v4 02/26] hw/ppc/e500: Remove firstenv variable |
Date: |
Sun, 3 Nov 2024 14:33:48 +0100 |
The firstenv variable is never read, so remove it. The env variable is then only
used inside the loop, so move it there to restrict its scope.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
hw/ppc/e500.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index ba83f33033..0683629ac0 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -899,7 +899,6 @@ void ppce500_init(MachineState *machine)
const PPCE500MachineClass *pmc = PPCE500_MACHINE_GET_CLASS(machine);
MachineClass *mc = MACHINE_CLASS(pmc);
PCIBus *pci_bus;
- CPUPPCState *env = NULL;
uint64_t loadaddr;
hwaddr kernel_base = -1LL;
int kernel_size = 0;
@@ -921,7 +920,6 @@ void ppce500_init(MachineState *machine)
IrqLines *irqs;
DeviceState *dev, *mpicdev;
DriveInfo *dinfo;
- CPUPPCState *firstenv = NULL;
MemoryRegion *ccsr_addr_space;
SysBusDevice *s;
PPCE500CCSRState *ccsr;
@@ -930,6 +928,7 @@ void ppce500_init(MachineState *machine)
irqs = g_new0(IrqLines, smp_cpus);
for (i = 0; i < smp_cpus; i++) {
PowerPCCPU *cpu;
+ CPUPPCState *env;
CPUState *cs;
cpu = POWERPC_CPU(object_new(machine->cpu_type));
@@ -950,10 +949,6 @@ void ppce500_init(MachineState *machine)
&error_abort);
qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal);
- if (!firstenv) {
- firstenv = env;
- }
-
irqs[i].irq[OPENPIC_OUTPUT_INT] =
qdev_get_gpio_in(DEVICE(cpu), PPCE500_INPUT_INT);
irqs[i].irq[OPENPIC_OUTPUT_CINT] =
@@ -974,8 +969,6 @@ void ppce500_init(MachineState *machine)
}
}
- env = firstenv;
-
if (!QEMU_IS_ALIGNED(machine->ram_size, RAM_SIZES_ALIGN)) {
error_report("RAM size must be multiple of %" PRIu64, RAM_SIZES_ALIGN);
exit(EXIT_FAILURE);
--
2.47.0
- [PATCH v4 00/26] E500 Cleanup, Bernhard Beschow, 2024/11/03
- [PATCH v4 01/26] hw/ppc/e500: Do not leak struct boot_info, Bernhard Beschow, 2024/11/03
- [PATCH v4 03/26] hw/ppc/e500: Prefer QOM cast, Bernhard Beschow, 2024/11/03
- [PATCH v4 02/26] hw/ppc/e500: Remove firstenv variable,
Bernhard Beschow <=
- [PATCH v4 04/26] hw/ppc/e500: Remove unused "irqs" parameter, Bernhard Beschow, 2024/11/03
- [PATCH v4 05/26] hw/ppc/e500: Add missing device tree properties to i2c controller node, Bernhard Beschow, 2024/11/03
- [PATCH v4 06/26] hw/ppc/e500: Reuse TYPE_GPIO_PWR, Bernhard Beschow, 2024/11/03
- [PATCH v4 07/26] hw/ppc/e500: Use SysBusDevice API to access TYPE_CCSR's internal resources, Bernhard Beschow, 2024/11/03
- [PATCH v4 12/26] hw/i2c/mpc_i2c: Prefer DEFINE_TYPES() macro, Bernhard Beschow, 2024/11/03
- [PATCH v4 08/26] hw/ppc/e500: Extract ppce500_ccsr.c, Bernhard Beschow, 2024/11/03
- [PATCH v4 09/26] hw/ppc/ppce500_ccsr: Trace access to CCSR region, Bernhard Beschow, 2024/11/03
- [PATCH v4 10/26] hw/ppc/mpc8544_guts: Populate POR PLL ratio status register, Bernhard Beschow, 2024/11/03
- [PATCH v4 13/26] hw/pci-host/ppce500: Reuse TYPE_PPC_E500_PCI_BRIDGE define, Bernhard Beschow, 2024/11/03