Received: from eggs.gnu.org ([2001:4830:134:3::10]:53419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV4UH-0001Oy-W7 for qemu-devel@nongnu.org; Mon, 09 Mar 2015 16:41:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YV4UD-0006mq-Qd for qemu-devel@nongnu.org; Mon, 09 Mar 2015 16:41:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YV4UD-0006mX-IU for qemu-devel@nongnu.org; Mon, 09 Mar 2015 16:41:13 -0400 From: Eduardo Habkost Date: Mon, 9 Mar 2015 17:40:47 -0300 Message-Id: <1425933651-20736-4-git-send-email-ehabkost@redhat.com> In-Reply-To: <1425933651-20736-1-git-send-email-ehabkost@redhat.com> References: <1425933651-20736-1-git-send-email-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 3/7] target-i386: Eliminate unnecessary get_cpuid_vendor() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Paolo Bonzini , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org The function was used in only two places. In one of them, the function made the code less readable by requiring temporary te[bcd]x variables. In the other one we can simply inline the existing code. Reviewed-by: Andreas F=C3=A4rber Signed-off-by: Eduardo Habkost --- target-i386/cpu.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 80e9b9d..2f3a450 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2213,14 +2213,6 @@ void x86_cpudef_setup(void) } } =20 -static void get_cpuid_vendor(CPUX86State *env, uint32_t *ebx, - uint32_t *ecx, uint32_t *edx) -{ - *ebx =3D env->cpuid_vendor1; - *edx =3D env->cpuid_vendor2; - *ecx =3D env->cpuid_vendor3; -} - void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) @@ -2254,7 +2246,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index= , uint32_t count, switch(index) { case 0: *eax =3D env->cpuid_level; - get_cpuid_vendor(env, ebx, ecx, edx); + *ebx =3D env->cpuid_vendor1; + *edx =3D env->cpuid_vendor2; + *ecx =3D env->cpuid_vendor3; break; case 1: *eax =3D env->cpuid_version; @@ -2447,11 +2441,9 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t inde= x, uint32_t count, * So dont set it here for Intel to make Linux guests happy. */ if (cs->nr_cores * cs->nr_threads > 1) { - uint32_t tebx, tecx, tedx; - get_cpuid_vendor(env, &tebx, &tecx, &tedx); - if (tebx !=3D CPUID_VENDOR_INTEL_1 || - tedx !=3D CPUID_VENDOR_INTEL_2 || - tecx !=3D CPUID_VENDOR_INTEL_3) { + if (env->cpuid_vendor1 !=3D CPUID_VENDOR_INTEL_1 || + env->cpuid_vendor2 !=3D CPUID_VENDOR_INTEL_2 || + env->cpuid_vendor3 !=3D CPUID_VENDOR_INTEL_3) { *ecx |=3D 1 << 1; /* CmpLegacy bit */ } } --=20 2.1.0