aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/ppc440_bamboo.c
diff options
context:
space:
mode:
authorBALATON Zoltan <balaton@eik.bme.hu>2022-09-24 14:27:50 +0200
committerDaniel Henrique Barboza <danielhb413@gmail.com>2022-10-17 16:15:09 -0300
commit1049ff55fe99df87dbec47db27749a88f494e846 (patch)
treeabc2615ebc7b41cd76bd617cb0227cd422fb25a0 /hw/ppc/ppc440_bamboo.c
parent9364df267fed0ba079f1f679849b5808f146a257 (diff)
downloadqemu-1049ff55fe99df87dbec47db27749a88f494e846.zip
qemu-1049ff55fe99df87dbec47db27749a88f494e846.tar.gz
qemu-1049ff55fe99df87dbec47db27749a88f494e846.tar.bz2
ppc440_bamboo: Remove unnecessary memsets
In ppc4xx_sdram_init() the struct is allocated with g_new0() so no need to clear its elements. In the bamboo machine init memset can be replaced with array initialiser which is shorter. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Message-Id: <529adc7705fb3e3e777439895bdaa136bacb9403.1664021647.git.balaton@eik.bme.hu> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'hw/ppc/ppc440_bamboo.c')
-rw-r--r--hw/ppc/ppc440_bamboo.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index ea945a1..5ec82fa 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -169,8 +169,8 @@ static void bamboo_init(MachineState *machine)
MemoryRegion *address_space_mem = get_system_memory();
MemoryRegion *isa = g_new(MemoryRegion, 1);
MemoryRegion *ram_memories = g_new(MemoryRegion, PPC440EP_SDRAM_NR_BANKS);
- hwaddr ram_bases[PPC440EP_SDRAM_NR_BANKS];
- hwaddr ram_sizes[PPC440EP_SDRAM_NR_BANKS];
+ hwaddr ram_bases[PPC440EP_SDRAM_NR_BANKS] = {0};
+ hwaddr ram_sizes[PPC440EP_SDRAM_NR_BANKS] = {0};
PCIBus *pcibus;
PowerPCCPU *cpu;
CPUPPCState *env;
@@ -205,8 +205,6 @@ static void bamboo_init(MachineState *machine)
qdev_get_gpio_in(DEVICE(cpu), PPC40x_INPUT_CINT));
/* SDRAM controller */
- memset(ram_bases, 0, sizeof(ram_bases));
- memset(ram_sizes, 0, sizeof(ram_sizes));
ppc4xx_sdram_banks(machine->ram, PPC440EP_SDRAM_NR_BANKS, ram_memories,
ram_bases, ram_sizes, ppc440ep_sdram_bank_sizes);
/* XXX 440EP's ECC interrupts are on UIC1, but we've only created UIC0. */