From patchwork Fri Oct 6 23:49:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 822797 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=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Wu2QJhbs"; dkim-atps=neutral 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 3y86P56Vrwz9t3R for ; Sat, 7 Oct 2017 11:11:21 +1100 (AEDT) Received: from localhost ([::1]:47629 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0ci8-0007NM-0G for incoming@patchwork.ozlabs.org; Fri, 06 Oct 2017 20:11:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cPY-00086U-C1 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cPX-0005db-FA for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:08 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:52760) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cPX-0005dM-Ag; Fri, 06 Oct 2017 19:52:07 -0400 Received: by mail-qt0-x242.google.com with SMTP id o52so34323323qtc.9; Fri, 06 Oct 2017 16:52:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wpv8EGIq3j7qi+6pArxULtJw2EKh1Du6IsovEPutuLs=; b=Wu2QJhbs8nhdYfcroDVS+z3fr4VgOy9Shr8Wfbe306M7G2WftJqjenM6tYWrTVvkBs EAFDcpZxCy7nNxnL8s6/rjIWLxODRKyWSll8fxZlsQznFW4IMct/bz1lryZWcgkaZGxw 81fk1zK3HQGDk4VhjmsibA2ItQH9/63e2cRxE3fQQOgNPCq0xVJL9q4lInGleCauEIYl Lr8Hq7Z14DxCUfx/VvCOZ8HW+Xbbyjf+n4A+O3X/A+0So3GZVzpYs1TSsMFPBdHuCNau 6voM8NuWA4PZQrsjLQFQWfwaQkX0kMAbfYUhsxbAoMICJeoQ75f4FQnu58OyRB+dyVFM tZ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wpv8EGIq3j7qi+6pArxULtJw2EKh1Du6IsovEPutuLs=; b=Wy4vhEK0H5YpwAr9Dg9HruJ9AB8mzxxyQEGte8JnoJFsD+pSuJQ0blEcPQIh1grQLq ftY3cOgNjU6Oh93T5VdOGNYtoaDAk7tGIYJJ0RkQC8Pwu/qfmReuArY+yH+oTaRI96sX e1qAb5BR1B1xUFbROB48F1VP8H1yG7C9W/vDL7NETEyUl92B03eRYEX8dUD5jnvTdlVh ig4W3OrV2/hFS5tDgNm/79Wgn5/mWsWer+cfdQ6MBooRT5K2l0uud2q9Vj+bWadYIM3D 10pYI2dTyJfemwCAbJiHevwilO7Dp7Dk8A9vB9LmsqLCF6+ohti7Tt7xTDjmQqzEIuFX pKfA== X-Gm-Message-State: AMCzsaVQC2IqAHgvmnsWk1VJXdaP0k2HS4NJzRuXuFM3iuUojGnlVnW/ v+KCQnO5KX9SE/Vx4KKPVoo= X-Google-Smtp-Source: AOwi7QCfG62t0e2P7AjL9jCsYL3DovkTIFpR1ZiDFN07ba3AP/yMaFRd6YCaAY8iANjvY19KgsUuFQ== X-Received: by 10.200.23.36 with SMTP id w33mr5651652qtj.50.1507333926782; Fri, 06 Oct 2017 16:52:06 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Markus Armbruster , Eric Blake , Magnus Damm , Aurelien Jarno Date: Fri, 6 Oct 2017 20:49:22 -0300 Message-Id: <20171006235023.11952-28-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::242 Subject: [Qemu-devel] [PATCH 27/88] SH4: 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: Kevin Wolf , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , qemu trival , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= 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 R2D] --- hw/sh4/r2d.c | 4 ++-- hw/sh4/sh7750.c | 2 +- hw/timer/sh_timer.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 16b9ed2db2..92d1fb99d7 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -186,7 +186,7 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem, { r2d_fpga_t *s; - s = g_malloc0(sizeof(r2d_fpga_t)); + s = g_new0(r2d_fpga_t, 1); s->irl = irl; @@ -249,7 +249,7 @@ static void r2d_init(MachineState *machine) cpu = SUPERH_CPU(cpu_generic_init(TYPE_SUPERH_CPU, cpu_model)); env = &cpu->env; - reset_info = g_malloc0(sizeof(ResetData)); + reset_info = g_new0(ResetData, 1); reset_info->cpu = cpu; reset_info->vector = env->pc; qemu_register_reset(main_cpu_reset, reset_info); diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c index 166e4bd947..49c49c110b 100644 --- a/hw/sh4/sh7750.c +++ b/hw/sh4/sh7750.c @@ -728,7 +728,7 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem) { SH7750State *s; - s = g_malloc0(sizeof(SH7750State)); + s = g_new0(SH7750State, 1); s->cpu = cpu; s->periph_freq = 60000000; /* 60MHz */ memory_region_init_io(&s->iomem, NULL, &sh7750_mem_ops, s, diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c index 9afb2d048c..46f3eb9647 100644 --- a/hw/timer/sh_timer.c +++ b/hw/timer/sh_timer.c @@ -192,7 +192,7 @@ static void *sh_timer_init(uint32_t freq, int feat, qemu_irq irq) sh_timer_state *s; QEMUBH *bh; - s = (sh_timer_state *)g_malloc0(sizeof(sh_timer_state)); + s = g_new0(sh_timer_state, 1); s->freq = freq; s->feat = feat; s->tcor = 0xffffffff; @@ -313,7 +313,7 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base, tmu012_state *s; int timer_feat = (feat & TMU012_FEAT_EXTCLK) ? TIMER_FEAT_EXTCLK : 0; - s = (tmu012_state *)g_malloc0(sizeof(tmu012_state)); + s = g_new0(tmu012_state, 1); s->feat = feat; s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq); s->timer[1] = sh_timer_init(freq, timer_feat, ch1_irq);