From: Marc-André Lureau <marcandre.lur...@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> [PMD: split of disas/sparc.c change] --- hw/sparc/leon3.c | 2 +- hw/sparc64/sparc64.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index ec2816bf94..05e7adefb8 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -132,7 +132,7 @@ static void leon3_generic_hw_init(MachineState *machine) cpu_sparc_set_id(env, 0); /* Reset data */ - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->sp = 0x40000000 + ram_size; qemu_register_reset(main_cpu_reset, reset_info); diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 097d529ff1..6f2197fc13 100644 --- a/hw/sparc64/sparc64.c +++ b/hw/sparc64/sparc64.c @@ -160,7 +160,7 @@ static CPUTimer *cpu_timer_create(const char *name, SPARCCPU *cpu, QEMUBHFunc *cb, uint32_t frequency, uint64_t disabled_mask, uint64_t npt_mask) { - CPUTimer *timer = g_malloc0(sizeof(CPUTimer)); + CPUTimer *timer = g_new0(CPUTimer, 1); timer->name = name; timer->frequency = frequency; @@ -368,7 +368,7 @@ SPARCCPU *sparc64_cpu_devinit(const char *cpu_model, hstick_frequency, TICK_INT_DIS, TICK_NPT_MASK); - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->prom_addr = prom_addr; qemu_register_reset(main_cpu_reset, reset_info); -- 2.14.2