[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 43/88] hw/core: use g_new() family of functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH 43/88] hw/core: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:49:38 -0300 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: added changes in hw/core/qdev.c]
---
hw/core/irq.c | 2 +-
hw/core/ptimer.c | 2 +-
hw/core/qdev.c | 2 +-
hw/core/reset.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/core/irq.c b/hw/core/irq.c
index b98d1d69f5..d9b13b1762 100644
--- a/hw/core/irq.c
+++ b/hw/core/irq.c
@@ -115,7 +115,7 @@ static void qemu_splitirq(void *opaque, int line, int level)
qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2)
{
- qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq));
+ qemu_irq *s = g_new0(qemu_irq, 2);
s[0] = irq1;
s[1] = irq2;
return qemu_allocate_irq(qemu_splitirq, s, 0);
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c
index 7221c68a98..ef4a6646ed 100644
--- a/hw/core/ptimer.c
+++ b/hw/core/ptimer.c
@@ -349,7 +349,7 @@ ptimer_state *ptimer_init(QEMUBH *bh, uint8_t policy_mask)
{
ptimer_state *s;
- s = (ptimer_state *)g_malloc0(sizeof(ptimer_state));
+ s = g_new0(ptimer_state, 1);
s->bh = bh;
s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ptimer_tick, s);
s->policy_mask = policy_mask;
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 606ab53c42..7b92af1013 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -378,7 +378,7 @@ static NamedGPIOList *qdev_get_named_gpio_list(DeviceState
*dev,
}
}
- ngl = g_malloc0(sizeof(*ngl));
+ ngl = g_new0(NamedGPIOList, 1);
ngl->name = g_strdup(name);
QLIST_INSERT_HEAD(&dev->gpios, ngl, node);
return ngl;
diff --git a/hw/core/reset.c b/hw/core/reset.c
index 84c8869371..01d86c3a95 100644
--- a/hw/core/reset.c
+++ b/hw/core/reset.c
@@ -40,7 +40,7 @@ static QTAILQ_HEAD(reset_handlers, QEMUResetEntry)
reset_handlers =
void qemu_register_reset(QEMUResetHandler *func, void *opaque)
{
- QEMUResetEntry *re = g_malloc0(sizeof(QEMUResetEntry));
+ QEMUResetEntry *re = g_new0(QEMUResetEntry, 1);
re->func = func;
re->opaque = opaque;
--
2.14.2
- [Qemu-trivial] [PATCH 35/88] Record/replay: use g_new() family of functions, (continued)
- [Qemu-trivial] [PATCH 35/88] Record/replay: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 36/88] SLIRP: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 37/88] TCG: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 38/88] VFIO: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 39/88] hw/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 40/88] hw/xen: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 42/88] XTFPGA: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 41/88] target/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 43/88] hw/core: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH 44/88] hw/core/loader: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 45/88] hw/display: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 46/88] hw/display/vga: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 47/88] hw/i2c: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 48/88] hw/input: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 49/88] hw/misc: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 50/88] ivshmem: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 51/88] hw/timer: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06