From: Josh Triplett Subject: [PATCH] xen: xen_init_cpuid_mask: Zero cx before calling xen_cpuid Date: Sat, 8 Aug 2009 13:15:00 -0700 Message-ID: <20090808201500.GA21828@feather> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org To: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com Cc: Andrew Morton , Jeremy Fitzhardinge List-Id: xen-devel@lists.xenproject.org CPUID function 1 doesn't use cx, but xen_cpuid doesn't know that, resulting in this warning: arch/x86/xen/enlighten.c: In function =E2=80=98xen_start_kernel=E2=80=99= : arch/x86/xen/enlighten.c:192: warning: =E2=80=98cx=E2=80=99 may be used= uninitialized in this function arch/x86/xen/enlighten.c:205: note: =E2=80=98cx=E2=80=99 was declared h= ere Set cx =3D 0 to avoid this warning. This seems preferable to implement= ing a xen_cpuid_nocount without the input constraint for cx, and either of those seem preferable to just ignoring the warning. Signed-off-by: Josh Triplett --- Build-tested only. arch/x86/xen/enlighten.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 0a1700a..6ee2ef8 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -215,6 +215,7 @@ static __init void xen_init_cpuid_mask(void) (1 << X86_FEATURE_ACPI)); /* disable ACPI */ =20 ax =3D 1; + cx =3D 0; xen_cpuid(&ax, &bx, &cx, &dx); =20 /* cpuid claims we support xsave; try enabling it to see what happens= */ --=20 1.5.6.5