From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[PMD: squashed milkymist]
---
hw/lm32/lm32_hwsetup.h | 2 +-
hw/lm32/lm32_boards.c | 4 ++--
hw/lm32/milkymist.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/lm32/lm32_hwsetup.h b/hw/lm32/lm32_hwsetup.h
index a01f6bc5df..38ade3db0e 100644
--- a/hw/lm32/lm32_hwsetup.h
+++ b/hw/lm32/lm32_hwsetup.h
@@ -58,7 +58,7 @@ static inline HWSetup *hwsetup_init(void)
{
HWSetup *hw;
- hw = g_malloc(sizeof(HWSetup));
+ hw = g_new(HWSetup, 1);
hw->data = g_malloc0(TARGET_PAGE_SIZE);
hw->ptr = hw->data;
diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c
index b0bb3ef58a..a9c74e90d4 100644
--- a/hw/lm32/lm32_boards.c
+++ b/hw/lm32/lm32_boards.c
@@ -99,7 +99,7 @@ static void lm32_evr_init(MachineState *machine)
int timer0_irq = 1;
int timer1_irq = 3;
- reset_info = g_malloc0(sizeof(ResetInfo));
+ reset_info = g_new0(ResetInfo, 1);
if (cpu_model == NULL) {
cpu_model = "lm32-full";
@@ -196,7 +196,7 @@ static void lm32_uclinux_init(MachineState *machine)
hwaddr initrd_base = 0x08400000;
size_t initrd_max = 0x01000000;
- reset_info = g_malloc0(sizeof(ResetInfo));
+ reset_info = g_new0(ResetInfo, 1);
if (cpu_model == NULL) {
cpu_model = "lm32-full";
diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
index 4db4d2d533..0335f0b322 100644
--- a/hw/lm32/milkymist.c
+++ b/hw/lm32/milkymist.c
@@ -106,7 +106,7 @@ milkymist_init(MachineState *machine)
hwaddr cmdline_base = sdram_base + 0x1000000;
size_t initrd_max = sdram_size - 0x1002000;
- reset_info = g_malloc0(sizeof(ResetInfo));
+ reset_info = g_new0(ResetInfo, 1);
if (cpu_model == NULL) {
cpu_model = "lm32-full";
--
2.14.2