[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH for-4.0 4/9] ppc405_uc: use g_new(T, n) instead of g_m
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH for-4.0 4/9] ppc405_uc: use g_new(T, n) instead of g_malloc(sizeof(T) * n) |
Date: |
Tue, 27 Nov 2018 14:05:38 +0100 |
User-agent: |
StGit/unknown-version |
Because it is a recommended coding practice (see HACKING).
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/ppc405_uc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index 5c58415cf1fd..e1aadf126d59 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -1519,7 +1519,7 @@ CPUPPCState *ppc405cr_init(MemoryRegion
*address_space_mem,
/* OBP arbitrer */
ppc4xx_opba_init(0xef600600);
/* Universal interrupt controller */
- irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB);
+ irqs = g_new0(qemu_irq, PPCUIC_OUTPUT_NB);
irqs[PPCUIC_OUTPUT_INT] =
((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT];
irqs[PPCUIC_OUTPUT_CINT] =
@@ -1877,7 +1877,7 @@ CPUPPCState *ppc405ep_init(MemoryRegion
*address_space_mem,
/* Initialize timers */
ppc_booke_timers_init(cpu, sysclk, 0);
/* Universal interrupt controller */
- irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB);
+ irqs = g_new0(qemu_irq, PPCUIC_OUTPUT_NB);
irqs[PPCUIC_OUTPUT_INT] =
((qemu_irq *)env->irq_inputs)[PPC40x_INPUT_INT];
irqs[PPCUIC_OUTPUT_CINT] =
- [Qemu-ppc] [PATCH for-4.0 0/9] ppc: get rid of g_malloc(sizeof(T) * n), Greg Kurz, 2018/11/27
- [Qemu-ppc] [PATCH for-4.0 4/9] ppc405_uc: use g_new(T, n) instead of g_malloc(sizeof(T) * n),
Greg Kurz <=
- [Qemu-ppc] [PATCH for-4.0 5/9] ppc440_bamboo: use g_new(T, n) instead of g_malloc(sizeof(T) * n), Greg Kurz, 2018/11/27
- [Qemu-ppc] [PATCH for-4.0 6/9] sam460ex: use g_new(T, n) instead of g_malloc(sizeof(T) * n), Greg Kurz, 2018/11/27
- [Qemu-ppc] [PATCH for-4.0 7/9] virtex_ml507: use g_new(T, n) instead of g_malloc(sizeof(T) * n), Greg Kurz, 2018/11/27
- [Qemu-ppc] [PATCH for-4.0 8/9] mac_newworld: simplify IRQ wiring, Greg Kurz, 2018/11/27