From patchwork Mon Oct 16 13:12:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 826272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFzKN4phjz9t3R for ; Tue, 17 Oct 2017 00:13:28 +1100 (AEDT) Received: from localhost ([::1]:32931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45Cw-0003JB-Om for incoming@patchwork.ozlabs.org; Mon, 16 Oct 2017 09:13:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55056) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e45CP-0003Gz-JR for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e45CO-00018N-JX for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45868) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e45CO-00017S-D4 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 09:12:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 82B4D13AA3; Mon, 16 Oct 2017 13:12:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 82B4D13AA3 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=thuth@redhat.com Received: from thh440s.str.redhat.com (dhcp-192-189.str.redhat.com [10.33.192.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id A52BF61349; Mon, 16 Oct 2017 13:12:47 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 16 Oct 2017 15:12:41 +0200 Message-Id: <1508159564-30317-3-git-send-email-thuth@redhat.com> In-Reply-To: <1508159564-30317-1-git-send-email-thuth@redhat.com> References: <1508159564-30317-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 16 Oct 2017 13:12:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/5] M68K: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dmitry Fleytman , peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Marc-André Lureau Signed-off-by: Marc-André Lureau Signed-off-by: Philippe Mathieu-Daudé [PMD: squashed commits] Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- 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,