From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, "Dmitry Fleytman" <dmitry@daynix.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [Qemu-devel] [PULL 2/5] M68K: use g_new() family of functions
Date: Mon, 16 Oct 2017 15:12:41 +0200 [thread overview]
Message-ID: <1508159564-30317-3-git-send-email-thuth@redhat.com> (raw)
In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com>
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 commits]
Reviewed-by: Thomas Huth <huth@tuxfamily.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/m68k/mcf5206.c | 4 ++--
hw/m68k/mcf5208.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
index fbf3f0f..bd8e993 100644
--- a/hw/m68k/mcf5206.c
+++ b/hw/m68k/mcf5206.c
@@ -138,7 +138,7 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)
m5206_timer_state *s;
QEMUBH *bh;
- s = (m5206_timer_state *)g_malloc0(sizeof(m5206_timer_state));
+ s = g_new0(m5206_timer_state, 1);
bh = qemu_bh_new(m5206_timer_trigger, s);
s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT);
s->irq = irq;
@@ -534,7 +534,7 @@ qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
m5206_mbar_state *s;
qemu_irq *pic;
- s = (m5206_mbar_state *)g_malloc0(sizeof(m5206_mbar_state));
+ s = g_new0(m5206_mbar_state, 1);
memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s,
"mbar", 0x00001000);
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index c9c5f5e..68589c3 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -184,7 +184,7 @@ static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic)
memory_region_add_subregion(address_space, 0xfc0a8000, iomem);
/* Timers. */
for (i = 0; i < 2; i++) {
- s = (m5208_timer_state *)g_malloc0(sizeof(m5208_timer_state));
+ s = g_new0(m5208_timer_state, 1);
bh = qemu_bh_new(m5208_timer_trigger, s);
s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT);
memory_region_init_io(&s->iomem, NULL, &m5208_timer_ops, s,
--
1.8.3.1
next prev parent reply other threads:[~2017-10-16 13:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-16 13:12 [Qemu-devel] [PULL 0/5] m68k, qtest and config patches Thomas Huth
2017-10-16 13:12 ` [Qemu-devel] [PULL 1/5] hw/m68k: Replace fprintf(stderr, "*\n" with error_report() Thomas Huth
2017-10-16 13:12 ` Thomas Huth [this message]
2017-10-16 13:12 ` [Qemu-devel] [PULL 3/5] tests: use g_new() family of functions Thomas Huth
2017-10-16 13:12 ` [Qemu-devel] [PULL 4/5] tests/prom-env: Bump the timeout, and test pseries only in slow mode Thomas Huth
2017-10-16 13:12 ` [Qemu-devel] [PULL 5/5] default-configs: Enable CONFIG_VMXNET3_PCI only on x86 Thomas Huth
2017-10-17 8:54 ` [Qemu-devel] [PULL 0/5] m68k, qtest and config patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1508159564-30317-3-git-send-email-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=dmitry@daynix.com \
--cc=f4bug@amsat.org \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).