From nobody Sun Feb 8 15:29:22 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1599078387; cv=none; d=zohomail.com; s=zohoarc; b=K+gp0YB4LAaNTiDoKWOXw+8sF5HVOPIrenOI+8eDGFgQddKDrfC+9kti63yaLBkOInFa7K5HbMeBmM9HIJB/xjcNPZt1ovlIhOJuNzdpvU78XszSA2WJTo4MRTx6AsHIM9hUcvm5FRIl1W7+MHXia0DRj8X4iABhqJg+i2sTvck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599078387; 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=iXx56rDB+7ex8mCqr0ZEeATVbpAUzxDa1CJLIY3UEWE=; b=C2iu03qdJk/D/dSpJrUh7sw0gTE+dz558bxjKsX4mq465ex22cQ7DAJHRJDF6GWa1jC8mveTTfnjmPeK9DnQnXgvUSvgTXVBJEgslu2SrGK0q0ndNuQtKO0aKbXDsZr+khheAmqzh4xjaKkvNqL3rjNQQR5eSHUAFIS9WxyM7xo= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1599078387778795.2281427441146; Wed, 2 Sep 2020 13:26:27 -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-256-eWmLzzDhPYaYXArcSA1DxA-1; Wed, 02 Sep 2020 16:26:25 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A77E880EF9F; Wed, 2 Sep 2020 20:26:18 +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 877AD87E22; Wed, 2 Sep 2020 20:26:18 +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 58A3E79DC0; Wed, 2 Sep 2020 20:26:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 082KQ27k002765 for ; Wed, 2 Sep 2020 16:26:03 -0400 Received: by smtp.corp.redhat.com (Postfix) id C95CC200AD55; Wed, 2 Sep 2020 20:26:02 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C4A36200A799 for ; Wed, 2 Sep 2020 20:25:59 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8BC2A18AE949 for ; Wed, 2 Sep 2020 20:25:59 +0000 (UTC) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-E4WOC6lQPfiTd8jAgOxu5w-1; Wed, 02 Sep 2020 16:25:57 -0400 Received: by mail-qk1-f194.google.com with SMTP id g72so986127qke.8 for ; Wed, 02 Sep 2020 13:25:57 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c7:d5bb:61e:5265:e62b:1233]) by smtp.gmail.com with ESMTPSA id b187sm547176qkd.107.2020.09.02.13.25.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 13:25:56 -0700 (PDT) X-MC-Unique: eWmLzzDhPYaYXArcSA1DxA-1 X-MC-Unique: E4WOC6lQPfiTd8jAgOxu5w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iXx56rDB+7ex8mCqr0ZEeATVbpAUzxDa1CJLIY3UEWE=; b=b1VUrAJAFM6vGJb0fVwoIKKvanzMahy7H0dqN7RfDul3DFgHOiobBn97ER7JTHMjIc Lu7dnhnk0+MXYqRaMePxOyYchcpRTm4Rql7ckjZE4hLIXyZmKtI7y2zkD6maJXUiIVxq L4VLgXlqhbp4LDsy6ApBdCz6iSRTYoYpUTyeSepkEZ3ZzyuseuR9BqX1hM76XOZQssPO 4jY1iU3JSNJPm7p4QsGX+54bpTVEt56PvkrLE6PSwXp4+v7qLKwTVxIo7vB5YKba3PRN 1ca21vFheKqPW3BRzPLrWKMei0FOlcRDcX8XiK6O5TL5wMu5leEPdE8hMMXaRvnVvf2A 4YXQ== X-Gm-Message-State: AOAM5307J80UBkxjg3sdHdJLeHliejsKFxZvvXkBLCmEWp0+5LpBmoYD x/egHxG+qP440ZwMIhN9Yt2Wy3YKp+h3ZA== X-Google-Smtp-Source: ABdhPJyawBJMxHT88Arz05G+SbuUuyNPR53Io2zKvtkQPOeBq56+9o4DNfbOyuzNeU+cc172XJMg2Q== X-Received: by 2002:a05:620a:ed3:: with SMTP id x19mr8116135qkm.89.1599078356876; Wed, 02 Sep 2020 13:25:56 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 01/12] cpu_ppc64.c: use typedefs for 'struct ppc64_vendor' Date: Wed, 2 Sep 2020 17:25:35 -0300 Message-Id: <20200902202546.483726-2-danielhb413@gmail.com> In-Reply-To: <20200902202546.483726-1-danielhb413@gmail.com> References: <20200902202546.483726-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false; X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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.11 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Introduce virCPUppc64Vendor and virCPUppc64VendorPtr types to improve code readability. Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 5b34c00a18..2a7c955781 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -34,19 +34,21 @@ VIR_LOG_INIT("cpu.cpu_ppc64"); =20 static const virArch archs[] =3D { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE }; =20 -struct ppc64_vendor { +typedef struct _ppc64_vendor virCPUppc64Vendor; +typedef struct _ppc64_vendor *virCPUppc64VendorPtr; +struct _ppc64_vendor { char *name; }; =20 struct ppc64_model { char *name; - const struct ppc64_vendor *vendor; + const virCPUppc64Vendor *vendor; virCPUppc64Data data; }; =20 struct ppc64_map { size_t nvendors; - struct ppc64_vendor **vendors; + virCPUppc64VendorPtr *vendors; size_t nmodels; struct ppc64_model **models; }; @@ -142,7 +144,7 @@ ppc64DataCopy(virCPUppc64Data *dst, const virCPUppc64Da= ta *src) } =20 static void -ppc64VendorFree(struct ppc64_vendor *vendor) +ppc64VendorFree(virCPUppc64VendorPtr vendor) { if (!vendor) return; @@ -151,7 +153,7 @@ ppc64VendorFree(struct ppc64_vendor *vendor) VIR_FREE(vendor); } =20 -static struct ppc64_vendor * +static virCPUppc64VendorPtr ppc64VendorFind(const struct ppc64_map *map, const char *name) { @@ -276,7 +278,7 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, void *data) { struct ppc64_map *map =3D data; - struct ppc64_vendor *vendor; + virCPUppc64VendorPtr vendor; int ret =3D -1; =20 if (VIR_ALLOC(vendor) < 0) @@ -691,7 +693,7 @@ virCPUppc64Baseline(virCPUDefPtr *cpus, { struct ppc64_map *map; const struct ppc64_model *model; - const struct ppc64_vendor *vendor =3D NULL; + const virCPUppc64Vendor *vendor =3D NULL; virCPUDefPtr cpu =3D NULL; size_t i; =20 @@ -705,7 +707,7 @@ virCPUppc64Baseline(virCPUDefPtr *cpus, } =20 for (i =3D 0; i < ncpus; i++) { - const struct ppc64_vendor *vnd; + const virCPUppc64Vendor *vnd; =20 /* Hosts running old (<=3D 1.2.18) versions of libvirt will report * strings like 'power7+' or 'power8e' instead of proper CPU model --=20 2.26.2