From nobody Mon Feb 9 18:46:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545371552592504.20291917779707; Thu, 20 Dec 2018 21:52:32 -0800 (PST) Received: from localhost ([::1]:42401 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaDjb-0004lu-3t for importer@patchew.org; Fri, 21 Dec 2018 00:52:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaDdi-0000Wc-MG for qemu-devel@nongnu.org; Fri, 21 Dec 2018 00:46:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaDdg-00070g-CY for qemu-devel@nongnu.org; Fri, 21 Dec 2018 00:46:26 -0500 Received: from ozlabs.org ([203.11.71.1]:54797) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gaDde-0006t0-Fg; Fri, 21 Dec 2018 00:46:23 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 43Ld0M3CLkz9sLt; Fri, 21 Dec 2018 16:46:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1545371171; bh=v9xetOTlWyXdAb4wnJZTE8QfPi1c1IyLAbgYH79kxKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jaxlla+Fy4xcayjVY+3U4dqoBivf0GuBdOKHq5j++04vlhNPZaTjPNiJNPhzhVzYF WmnNcCZB1Ldwk25o2u6xAKfayLq157AgNRbU7n5HaMGd7EyCMTgdeLiOyaa4xxrgVr A3N2+rKzc4ygO2GBOCBu9Qq1JPBQbyRsDmDALzrY= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 21 Dec 2018 16:45:33 +1100 Message-Id: <20181221054606.22007-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181221054606.22007-1-david@gibson.dropbear.id.au> References: <20181221054606.22007-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 07/40] spapr: use g_new(T, n) instead of g_malloc(sizeof(T) * n) 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: gkurz@redhat.com, lvivier@redhat.com, Greg Kurz , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Greg Kurz Because it is a recommended coding practice (see HACKING). Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr_iommu.c | 2 +- hw/ppc/spapr_vio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 1b0880ac9e..b56466f89a 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -93,7 +93,7 @@ static uint64_t *spapr_tce_alloc_table(uint32_t liobn, =20 if (!table) { *fd =3D -1; - table =3D g_malloc0(nb_table * sizeof(uint64_t)); + table =3D g_new0(uint64_t, nb_table); } =20 trace_spapr_iommu_new_table(liobn, table, *fd); diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 840d4a3c45..7e8a9ad093 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -730,7 +730,7 @@ void spapr_dt_vdevice(VIOsPAPRBus *bus, void *fdt) } =20 /* Copy out into an array of pointers */ - qdevs =3D g_malloc(sizeof(qdev) * num); + qdevs =3D g_new(DeviceState *, num); num =3D 0; QTAILQ_FOREACH(kid, &bus->bus.children, sibling) { qdevs[num++] =3D kid->child; --=20 2.19.2