From nobody Tue Feb 10 02:49:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1599830647; cv=none; d=zohomail.com; s=zohoarc; b=MCqV8SYaV+9BuC/+eJ/+s/Rrd0NrE80w2Vin1jHw+b7MeK2hXv5wJeN9eP8NZ2XKwnPgRfEcHI2Mzt4jC/FGfiizeJabpHvsGLoAsg6XWsjRX/03525YC9BXfrGdmqhefkANGYc4lEZUWB9QyhG/EMj3Se3inISxEPFQ8HIIfzY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830647; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zuGtsAW/xKEW7+FyOOGgZpHZjs3B7TC3kDnLItwB46s=; b=i819UGd+DSDmUJOGtG3QLhtbfAf7zqHvnK5GBw7S2r5IOjrOWxW3uSBf7vNhYTZ+c4n+dfOfO+jqY8LuiLjvv+RpGweIhiIT1j93e2cX/HRG+yDeory0ERnCgkNQjfBsmVi4UYSmsapV81bl1AerZWChDUrPUv+9j+B5oUPVp5A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1599830647035333.1886652210509; Fri, 11 Sep 2020 06:24:07 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-514-9axTAJpvOXSxqxaSrkSiSQ-1; Fri, 11 Sep 2020 09:23:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 343E21008565; Fri, 11 Sep 2020 13:23:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 148887838A; Fri, 11 Sep 2020 13:23:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id D7024181A89E; Fri, 11 Sep 2020 13:23:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08BDN8ru025422 for ; Fri, 11 Sep 2020 09:23:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id EEE5760C47; Fri, 11 Sep 2020 13:23:08 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-163.ams2.redhat.com [10.36.112.163]) by smtp.corp.redhat.com (Postfix) with ESMTP id EAB9A60C04; Fri, 11 Sep 2020 13:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830645; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=zuGtsAW/xKEW7+FyOOGgZpHZjs3B7TC3kDnLItwB46s=; b=IsEP851JOrLKfLvdFQ7WXAdp1WU6vTBjV5Nm54xe3PS/e2TAU80FZAAJFf+SDexKl+3OJr CU2riM0pjDR24HD20LDQ7gFkIm8y+K21e8BL5B4Rb0culUleobid/Xh1fjq9ME/ZqbF8eX lpwG63xs30M5Y7O2BlBiyzfFLJn5BRU= X-MC-Unique: 9axTAJpvOXSxqxaSrkSiSQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 7/8] cpu: Replace VIR_ALLOC_N with g_new0 Date: Fri, 11 Sep 2020 15:22:48 +0200 Message-Id: <20200911132249.514503-8-twiederh@redhat.com> In-Reply-To: <20200911132249.514503-1-twiederh@redhat.com> References: <20200911132249.514503-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?J=C3=A1n=20Tomko?= , Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Signed-off-by: Tim Wiederhake Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index ca2cfa0a67..6477b4bce7 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -134,9 +134,7 @@ ppc64DataCopy(virCPUppc64Data *dst, const virCPUppc64Da= ta *src) { size_t i; =20 - if (VIR_ALLOC_N(dst->pvr, src->len) < 0) - return -1; - + dst->pvr =3D g_new0(virCPUppc64PVR, src->len); dst->len =3D src->len; =20 for (i =3D 0; i < src->len; i++) { @@ -343,9 +341,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, return -1; } =20 - if (VIR_ALLOC_N(model->data.pvr, n) < 0) - return -1; - + model->data.pvr =3D g_new0(virCPUppc64PVR, n); model->data.len =3D n; =20 for (i =3D 0; i < n; i++) { @@ -603,10 +599,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, return -1; =20 data =3D &cpuData->data.ppc64; - - if (VIR_ALLOC_N(data->pvr, 1) < 0) - return -1; - + data->pvr =3D g_new0(virCPUppc64PVR, 1); data->len =3D 1; =20 #if defined(__powerpc__) || defined(__powerpc64__) @@ -732,8 +725,7 @@ virCPUppc64DriverGetModels(char ***models) return -1; =20 if (models) { - if (VIR_ALLOC_N(*models, map->nmodels + 1) < 0) - return -1; + *models =3D g_new0(char*, map->nmodels + 1); =20 for (i =3D 0; i < map->nmodels; i++) (*models)[i] =3D g_strdup(map->models[i]->name); --=20 2.26.2