From nobody Thu May 15 13:50:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1507129894964717.2076507553293; Wed, 4 Oct 2017 08:11:34 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id E97C661469; Wed, 4 Oct 2017 15:11:33 +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 BDC4560179; Wed, 4 Oct 2017 15:11:33 +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 7F3033FAD0; Wed, 4 Oct 2017 15:11:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v94Ewtax006819 for ; Wed, 4 Oct 2017 10:58:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A6A063626; Wed, 4 Oct 2017 14:58:55 +0000 (UTC) Received: from mamuti.net (unknown [10.34.246.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 499476362F for ; Wed, 4 Oct 2017 14:58:55 +0000 (UTC) Received: by mamuti.net (Postfix, from userid 500) id 42C57103035; Wed, 4 Oct 2017 16:58:50 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E97C661469 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: Jiri Denemark To: libvir-list@redhat.com Date: Wed, 4 Oct 2017 16:58:32 +0200 Message-Id: <4dcf8138c641a4dd7898d95165a7c6d738779b44.1507128897.git.jdenemar@redhat.com> In-Reply-To: References: In-Reply-To: References: Mail-Followup-To: libvir-list@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/23] cpu_x86: Move x86FeatureFind* to avoid forward prototypes 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 04 Oct 2017 15:11:34 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Jiri Denemark Reviewed-by: John Ferlan --- src/cpu/cpu_x86.c | 61 ++++++++++++++++++++++++++++-----------------------= ---- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 198e80a5c2..e197e31310 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -240,6 +240,37 @@ x86cpuidAndBits(virCPUx86CPUID *cpuid, cpuid->edx &=3D mask->edx; } =20 + +static virCPUx86FeaturePtr +x86FeatureFind(virCPUx86MapPtr map, + const char *name) +{ + size_t i; + + for (i =3D 0; i < map->nfeatures; i++) { + if (STREQ(map->features[i]->name, name)) + return map->features[i]; + } + + return NULL; +} + + +static virCPUx86FeaturePtr +x86FeatureFindInternal(const char *name) +{ + size_t i; + size_t count =3D ARRAY_CARDINALITY(x86_kvm_features); + + for (i =3D 0; i < count; i++) { + if (STREQ(x86_kvm_features[i].name, name)) + return x86_kvm_features + i; + } + + return NULL; +} + + static int virCPUx86CPUIDSorter(const void *a, const void *b) { @@ -753,36 +784,6 @@ x86FeatureFree(virCPUx86FeaturePtr feature) } =20 =20 -static virCPUx86FeaturePtr -x86FeatureFind(virCPUx86MapPtr map, - const char *name) -{ - size_t i; - - for (i =3D 0; i < map->nfeatures; i++) { - if (STREQ(map->features[i]->name, name)) - return map->features[i]; - } - - return NULL; -} - - -static virCPUx86FeaturePtr -x86FeatureFindInternal(const char *name) -{ - size_t i; - size_t count =3D ARRAY_CARDINALITY(x86_kvm_features); - - for (i =3D 0; i < count; i++) { - if (STREQ(x86_kvm_features[i].name, name)) - return x86_kvm_features + i; - } - - return NULL; -} - - static int x86FeatureInData(const char *name, const virCPUx86Data *data, --=20 2.14.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list