From nobody Mon Feb 9 16:02:30 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1599830605; cv=none; d=zohomail.com; s=zohoarc; b=nj0YIZIHE+Zqpw2q9IdgA7NoIJzsO/hZhPppXAp7pGWxn4Ahy2It0V5EUstTa2GdfIeaHVpoBTt79PyAhK2k2Q6BbXmwGnpoOuB8gsF0aZlT6dfiZyL6rceTXj2bdYrok1lMgbgtlPS18gqFZ6WPIzhcFUxV6O9BwGyITGFl2yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599830605; 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=mt0a32UP2Zk0RB/Sx3bMCPWV69enGW+uVc96DyvlM5Y=; b=MGXoqdLYXjMXs/tssSknXEBVemPgby/l7NTpA/u7AHKaqzyfY7LUuIPGznv2/AnXzD4Cmz03IM1t7N3oGWN5lzs4dIduywFGX+ccqVEEKCOgVKpWpih88shdP11yKKd6KqVT6fZvJm8SoIPYDDE3+3omwposbRRSfswanx/MakI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1599830605591382.5753647455774; Fri, 11 Sep 2020 06:23:25 -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-565-G0erKOEWOGCfbM-Ihvlh3g-1; Fri, 11 Sep 2020 09:23:17 -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 DDBCA10BBEE5; Fri, 11 Sep 2020 13:23:10 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BAECE81C4B; Fri, 11 Sep 2020 13:23:10 +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 87B269230D; 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 08BDN7Kc025405 for ; Fri, 11 Sep 2020 09:23:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8EAF860C15; Fri, 11 Sep 2020 13:23:07 +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 9488860C04; Fri, 11 Sep 2020 13:23:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599830600; 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=mt0a32UP2Zk0RB/Sx3bMCPWV69enGW+uVc96DyvlM5Y=; b=Gwj9WvOPM5og6Gn0T8jtxEqyyxryRQwen5ioeuyoSnx9vjVey9bpptB2jC/CfZbskV1S07 JeieRWfm/tB+gVDGuUMUSgONjpU6qGRWbdS4znlXJT267V2ZKKaPIvs1w+kIlCXuMUoiWp YwMst9Z/ANtgPRzXd3YTpXB//Eci4DU= X-MC-Unique: G0erKOEWOGCfbM-Ihvlh3g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH v3 6/8] cpu: Replace VIR_ALLOC with g_new0 Date: Fri, 11 Sep 2020 15:22:47 +0200 Message-Id: <20200911132249.514503-7-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.001 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.c | 4 +--- src/cpu/cpu_ppc64.c | 19 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 69e4205e4b..c3eef52c79 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -286,9 +286,7 @@ virCPUDataNew(virArch arch) { virCPUDataPtr data; =20 - if (VIR_ALLOC(data) < 0) - return NULL; - + data =3D g_new0(virCPUData, 1); data->arch =3D arch; =20 return data; diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index c0d09db696..ca2cfa0a67 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -189,9 +189,7 @@ ppc64ModelCopy(const virCPUppc64Model *model) { g_autoptr(virCPUppc64Model) copy =3D NULL; =20 - if (VIR_ALLOC(copy) < 0) - return NULL; - + copy =3D g_new0(virCPUppc64Model, 1); copy->name =3D g_strdup(model->name); =20 if (ppc64DataCopy(©->data, &model->data) < 0) @@ -283,9 +281,7 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, virCPUppc64MapPtr map =3D data; g_autoptr(virCPUppc64Vendor) vendor =3D NULL; =20 - if (VIR_ALLOC(vendor) < 0) - return -1; - + vendor =3D g_new0(virCPUppc64Vendor, 1); vendor->name =3D g_strdup(name); =20 if (ppc64VendorFind(map, vendor->name)) { @@ -314,9 +310,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, size_t i; int n; =20 - if (VIR_ALLOC(model) < 0) - return -1; - + model =3D g_new0(virCPUppc64Model, 1); model->name =3D g_strdup(name); =20 if (ppc64ModelFind(map, model->name)) { @@ -386,8 +380,7 @@ ppc64LoadMap(void) { g_autoptr(virCPUppc64Map) map =3D NULL; =20 - if (VIR_ALLOC(map) < 0) - return NULL; + map =3D g_new0(virCPUppc64Map, 1); =20 if (cpuMapLoad("ppc64", ppc64VendorParse, NULL, ppc64ModelParse, map) = < 0) return NULL; @@ -401,9 +394,7 @@ ppc64MakeCPUData(virArch arch, { g_autoptr(virCPUData) cpuData =3D NULL; =20 - if (VIR_ALLOC(cpuData) < 0) - return NULL; - + cpuData =3D g_new0(virCPUData, 1); cpuData->arch =3D arch; =20 if (ppc64DataCopy(&cpuData->data.ppc64, data) < 0) --=20 2.26.2