From nobody Tue Feb 10 23:00:48 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507337010434754.0305562384981; Fri, 6 Oct 2017 17:43:30 -0700 (PDT) Received: from localhost ([::1]:47827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0dD4-0002ho-Sk for importer@patchew.org; Fri, 06 Oct 2017 20:43:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42810) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cRR-0001Kd-12 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cRP-0007BW-TZ for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:54:05 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cRP-0007B0-O3; Fri, 06 Oct 2017 19:54:03 -0400 Received: by mail-qk0-x242.google.com with SMTP id z14so12861984qkg.3; Fri, 06 Oct 2017 16:54:03 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.54.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:54:02 -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=/87O0wcJzkuMaVGLZDwjtPPj6/UloO+mmd50YR5m0nc=; b=YX5ExWtGijvlSpP7w1imZ4KX4neCw2fwm2aomGXoDJFBCcXzVX08aVpPiZbrrvTtmp MRrg2uqpcmUrgmfFEjxtCSsGOmbVQhViINEXsZQXayKfiSNKXQKgYCmyFtx6jPHSv2sq SXmYE1GyugBM888EMPirQ35UNJeeM/AVqPrj3brfq2haINFioWPdTE+ogPDdUGrNZZOU nVbq3bdZOVU+tnSTd4a6LCOu5gzUvDwAYwPDy2mKTK1pOULaDxH2Cm/PFQOUEZ9EhGVJ qluqgAHe416AEFne8oJsbLJp4Swmf43t3jRS8hvvfEMo+POb9TnzLowJ5i5wL/dWVgQg ZwxQ== 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=/87O0wcJzkuMaVGLZDwjtPPj6/UloO+mmd50YR5m0nc=; b=AdnIrnTGZI0v0mXAV8ugxH7i6eNyKXBtq+9nE1UkZdpAnHeIGnfsCbBSqgVRWof5iY gJhVLf5+nUbk1DFBaa0MnCFtJrNJ1l/Tw/sOqcVz5+Era1lgN7KA0pn8H3Qcs2POWxsX HWOt3OzS3tQ//4oqRDrb8xOso6UCToQND3gC4aZ1Wzhg+U7z4B1L+VCA01eC6LXFq7XY vrTk8UmOmuOyk1SklIsS1W/nRQ2aDjviGxG9+DIqYmGDwo6Ai8fQqwwgMQw+AXb2YmUU 8DA6Y8RTtNXVhi3scRFEo/dBGheJMW7edQMYHYHIlL+kb9Dl/f//CLU9igSyTklClR9i fbZw== X-Gm-Message-State: AMCzsaVUO7/x7ZNeGA0GF2Ox2xiiNnsgK7+mfbonFnpLkT79XPuB1+lv VMp5kO032AW3maXDKrMC9OL6sleL2aE= X-Google-Smtp-Source: AOwi7QA7zPDRJB/JvOtTIUjHwjoNTtZK6DwPRuKi0Y2KdKw6ob+vIOgETjl8IifOacAamhh7pGVleA== X-Received: by 10.55.6.149 with SMTP id 143mr673395qkg.231.1507334043167; Fri, 06 Oct 2017 16:54:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Eric Blake , Alexander Graf Date: Fri, 6 Oct 2017 20:49:55 -0300 Message-Id: <20171006235023.11952-61-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 60/88] sPAPR: 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 , qemu trival , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 [PMD: one more change in hw/ppc/spapr_events.c, added hw/intc/xics_kvm.c and tests/libqos/pci-spapr.c] --- hw/intc/xics.c | 2 +- hw/intc/xics_kvm.c | 4 ++-- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_events.c | 4 ++-- hw/ppc/spapr_iommu.c | 2 +- hw/ppc/spapr_pci.c | 2 +- tests/libqos/pci-spapr.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index cc9816e7f2..e7e1605a1c 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -603,7 +603,7 @@ static void ics_simple_realize(ICSState *ics, Error **e= rrp) error_setg(errp, "Number of interrupts needs to be greater 0"); return; } - ics->irqs =3D g_malloc0(ics->nr_irqs * sizeof(ICSIRQState)); + ics->irqs =3D g_new0(ICSIRQState, ics->nr_irqs); ics->qirqs =3D qemu_allocate_irqs(ics_simple_set_irq, ics, ics->nr_irq= s); =20 qemu_register_reset(ics_simple_reset, ics); diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 3091ad3ac2..e6742b0118 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -143,7 +143,7 @@ static void icp_kvm_realize(ICPState *icp, Error **errp) strerror(errno)); return; } - enabled_icp =3D g_malloc(sizeof(*enabled_icp)); + enabled_icp =3D g_new(KVMEnabledICP, 1); enabled_icp->vcpu_id =3D vcpu_id; QLIST_INSERT_HEAD(&kvm_enabled_icps, enabled_icp, node); } @@ -334,7 +334,7 @@ static void ics_kvm_realize(ICSState *ics, Error **errp) error_setg(errp, "Number of interrupts needs to be greater 0"); return; } - ics->irqs =3D g_malloc0(ics->nr_irqs * sizeof(ICSIRQState)); + ics->irqs =3D g_new0(ICSIRQState, ics->nr_irqs); ics->qirqs =3D qemu_allocate_irqs(ics_kvm_set_irq, ics, ics->nr_irqs); =20 qemu_register_reset(ics_kvm_reset, ics); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ff87f155d5..53492595f2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2988,7 +2988,7 @@ static sPAPRDIMMState *spapr_pending_dimm_unplugs_add= (sPAPRMachineState *spapr, */ ds =3D spapr_pending_dimm_unplugs_find(spapr, dimm); if (!ds) { - ds =3D g_malloc0(sizeof(sPAPRDIMMState)); + ds =3D g_new0(sPAPRDIMMState, 1); ds->nr_lmbs =3D nr_lmbs; ds->dimm =3D dimm; QTAILQ_INSERT_HEAD(&spapr->pending_dimm_unplugs, ds, next); diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c index e377fc7dde..0ff4c2404f 100644 --- a/hw/ppc/spapr_events.c +++ b/hw/ppc/spapr_events.c @@ -437,7 +437,7 @@ static void spapr_powerdown_req(Notifier *n, void *opaq= ue) struct epow_extended_log *new_epow; =20 entry =3D g_new(sPAPREventLogEntry, 1); - new_epow =3D g_malloc0(sizeof(*new_epow)); + new_epow =3D g_new0(struct epow_extended_log, 1); entry->extended_log =3D new_epow; =20 v6hdr =3D &new_epow->v6hdr; @@ -490,7 +490,7 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint= 8_t hp_action, struct rtas_event_log_v6_hp *hp; =20 entry =3D g_new(sPAPREventLogEntry, 1); - new_hp =3D g_malloc0(sizeof(struct hp_extended_log)); + new_hp =3D g_new0(struct hp_extended_log, 1); entry->extended_log =3D new_hp; =20 v6hdr =3D &new_hp->v6hdr; diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 5ccd785d5a..36cf3d6908 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_pci.c b/hw/ppc/spapr_pci.c index 5049ced4e8..4ec31f65c5 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1825,7 +1825,7 @@ static int spapr_pci_pre_save(void *opaque) if (!sphb->msi_devs_num) { return 0; } - sphb->msi_devs =3D g_malloc(sphb->msi_devs_num * sizeof(spapr_pci_msi_= mig)); + sphb->msi_devs =3D g_new(spapr_pci_msi_mig, sphb->msi_devs_num); =20 g_hash_table_iter_init(&iter, sphb->msi); for (i =3D 0; g_hash_table_iter_next(&iter, &key, &value); ++i) { diff --git a/tests/libqos/pci-spapr.c b/tests/libqos/pci-spapr.c index 2043f1e123..e3816ec29f 100644 --- a/tests/libqos/pci-spapr.c +++ b/tests/libqos/pci-spapr.c @@ -158,7 +158,7 @@ QPCIBus *qpci_init_spapr(QGuestAllocator *alloc) { QPCIBusSPAPR *ret; =20 - ret =3D g_malloc(sizeof(*ret)); + ret =3D g_new(QPCIBusSPAPR, 1); =20 ret->alloc =3D alloc; =20 --=20 2.14.2