From nobody Sun Feb 8 11:25:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1599078393; cv=none; d=zohomail.com; s=zohoarc; b=Ta3JnWfrAz4re6td2iP95y1NSzyfoyPYkblOuG2vAdWujCYKvoFxnbeVIXXhvWrQkDDjcYnM2bYiN7gs26gvC8/cef4O6Te3/pbKTOwfN2p9yQutbs7pby/dZdpWFQeR8y2yTpTe9686qoaAf2XwQOPLrVMi8TutFpfa5XiCru8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599078393; 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=+TfnEwk9hg/fQwUUGcTH+YBGALT9DrQeTGoAOCJH3R0=; b=gAPY/QUdy8I8YRnTWVrBHdMTbbnLW5xYInuBnybs2mTSOERliHo7vyB0S/16KIBWUu977c3Z3z7kmHCJ79tGKGEKvLHHCuzKd21itdC1dhvt7L98mb9LGKIt2v8LPOVGa0eoKTde07NuxUCudDFbvfrhJZSIZEX5v69ecg2+YdE= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1599078393797403.46502854645223; Wed, 2 Sep 2020 13:26:33 -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-395-5L6O0BJmOd2_T_XA7gxsBQ-1; Wed, 02 Sep 2020 16:26:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 699D7802B45; Wed, 2 Sep 2020 20:26:24 +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 456551010405; Wed, 2 Sep 2020 20:26:24 +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 14352183D027; Wed, 2 Sep 2020 20:26:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 082KQ9e3002843 for ; Wed, 2 Sep 2020 16:26:09 -0400 Received: by smtp.corp.redhat.com (Postfix) id 21C1B2157F25; Wed, 2 Sep 2020 20:26:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1CBAE2157F26 for ; Wed, 2 Sep 2020 20:26:09 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 034B280121F for ; Wed, 2 Sep 2020 20:26:09 +0000 (UTC) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-x0VXsDR7Puy-5lLxXK-NNQ-1; Wed, 02 Sep 2020 16:26:06 -0400 Received: by mail-qt1-f195.google.com with SMTP id n18so257148qtw.0 for ; Wed, 02 Sep 2020 13:26:06 -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.26.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2020 13:26:05 -0700 (PDT) X-MC-Unique: 5L6O0BJmOd2_T_XA7gxsBQ-1 X-MC-Unique: x0VXsDR7Puy-5lLxXK-NNQ-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=+TfnEwk9hg/fQwUUGcTH+YBGALT9DrQeTGoAOCJH3R0=; b=msan/zubdlNkLvsPKnvPNy8/5XSPcAs6A5bA9t5Jg3GVOQtVNNo9pBRG8pKh4wiD/V bb2qp0Zgxv7zr221WPba/Hfc+QLLDDkgSlMrMMl3zo470cYjmtKlyS4RfGaMQfO5Z0FE FoMwJMzhfu6qboFuB7kkAdK3aqeOkMv8qEijSTgUN2hMdmHIRoiGl0CGdKgjwOQMRNDU D554SsgErUJdycYw20IKplnc36CElgfneX6T66ICsCsFRpS0biKsppAVNICrY5ugGf77 ShY9G+rxqgukHc7nb6R/RzrUGOcKNT175SCWWIQS3ImIRNCUZ0xJrrszRROVwlfRYhY2 VLbw== X-Gm-Message-State: AOAM532hrol9eRJ3itKqemhGwRQwpIH6Cwvd+OMsRM5TWqe829k7HKHn 8/cM8sPIpMR9lAjkdFYth7B6+jMJNi+5NQ== X-Google-Smtp-Source: ABdhPJymvxY9NCplBzcwi1Mn7mD/bxu5PLcvGBgr+Id90+B0KQ60/qS6WvoJIQeWYyvhzvwSbVvDcQ== X-Received: by 2002:ac8:7650:: with SMTP id i16mr11072qtr.268.1599078366044; Wed, 02 Sep 2020 13:26:06 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 07/12] cpu_ppc64.c: use typedefs for 'struct ppc64_map' Date: Wed, 2 Sep 2020 17:25:41 -0300 Message-Id: <20200902202546.483726-8-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.6 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.84 on 10.5.11.22 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 virCPUppc64Map and virCPUppc64MapPtr types to improve code readability. Signed-off-by: Daniel Henrique Barboza Reviewed-by: J=C3=A1n Tomko --- src/cpu/cpu_ppc64.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index cae96c94a1..261fe3dbe6 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -48,7 +48,9 @@ struct _ppc64_model { virCPUppc64Data data; }; =20 -struct ppc64_map { +typedef struct _ppc64_map virCPUppc64Map; +typedef struct _ppc64_map *virCPUppc64MapPtr; +struct _ppc64_map { size_t nvendors; virCPUppc64VendorPtr *vendors; size_t nmodels; @@ -157,7 +159,7 @@ ppc64VendorFree(virCPUppc64VendorPtr vendor) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Vendor, ppc64VendorFree); =20 static virCPUppc64VendorPtr -ppc64VendorFind(const struct ppc64_map *map, +ppc64VendorFind(const virCPUppc64Map *map, const char *name) { size_t i; @@ -201,7 +203,7 @@ ppc64ModelCopy(const virCPUppc64Model *model) } =20 static virCPUppc64ModelPtr -ppc64ModelFind(const struct ppc64_map *map, +ppc64ModelFind(const virCPUppc64Map *map, const char *name) { size_t i; @@ -215,7 +217,7 @@ ppc64ModelFind(const struct ppc64_map *map, } =20 static virCPUppc64ModelPtr -ppc64ModelFindPVR(const struct ppc64_map *map, +ppc64ModelFindPVR(const virCPUppc64Map *map, uint32_t pvr) { size_t i; @@ -234,7 +236,7 @@ ppc64ModelFindPVR(const struct ppc64_map *map, =20 static virCPUppc64ModelPtr ppc64ModelFromCPU(const virCPUDef *cpu, - const struct ppc64_map *map) + const virCPUppc64Map *map) { virCPUppc64ModelPtr model; =20 @@ -254,7 +256,7 @@ ppc64ModelFromCPU(const virCPUDef *cpu, } =20 static void -ppc64MapFree(struct ppc64_map *map) +ppc64MapFree(virCPUppc64MapPtr map) { size_t i; =20 @@ -277,7 +279,7 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, const char *name, void *data) { - struct ppc64_map *map =3D data; + virCPUppc64MapPtr map =3D data; g_autoptr(virCPUppc64Vendor) vendor =3D NULL; =20 if (VIR_ALLOC(vendor) < 0) @@ -303,7 +305,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - struct ppc64_map *map =3D data; + virCPUppc64MapPtr map =3D data; g_autoptr(virCPUppc64Model) model =3D NULL; xmlNodePtr *nodes =3D NULL; char *vendor =3D NULL; @@ -384,10 +386,10 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, } =20 =20 -static struct ppc64_map * +static virCPUppc64MapPtr ppc64LoadMap(void) { - struct ppc64_map *map; + virCPUppc64MapPtr map; =20 if (VIR_ALLOC(map) < 0) goto error; @@ -425,7 +427,7 @@ ppc64Compute(virCPUDefPtr host, virCPUDataPtr *guestData, char **message) { - struct ppc64_map *map =3D NULL; + virCPUppc64MapPtr map =3D NULL; g_autoptr(virCPUppc64Model) host_model =3D NULL; g_autoptr(virCPUppc64Model) guest_model =3D NULL; virCPUDefPtr cpu =3D NULL; @@ -583,7 +585,7 @@ ppc64DriverDecode(virCPUDefPtr cpu, virDomainCapsCPUModelsPtr models) { int ret =3D -1; - struct ppc64_map *map; + virCPUppc64MapPtr map; const virCPUppc64Model *model; =20 if (!data || !(map =3D ppc64LoadMap())) @@ -683,7 +685,7 @@ virCPUppc64Baseline(virCPUDefPtr *cpus, const char **features G_GNUC_UNUSED, bool migratable G_GNUC_UNUSED) { - struct ppc64_map *map; + virCPUppc64MapPtr map; const virCPUppc64Model *model; const virCPUppc64Vendor *vendor =3D NULL; virCPUDefPtr cpu =3D NULL; @@ -772,7 +774,7 @@ virCPUppc64Baseline(virCPUDefPtr *cpus, static int virCPUppc64DriverGetModels(char ***models) { - struct ppc64_map *map; + virCPUppc64MapPtr map; size_t i; int ret =3D -1; =20 --=20 2.26.2