From: Arnd Bergmann Date: Wed, 4 Apr 2018 10:44:14 +0000 (+0200) Subject: x86: kvm: hide the unused 'cpu' variable X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=51e8a8cc2f2d4295703f9c7ff66dead565dfea9a;p=openwrt%2Fstaging%2Fblogic.git x86: kvm: hide the unused 'cpu' variable The local variable was newly introduced but is only accessed in one place on x86_64, but not on 32-bit: arch/x86/kvm/vmx.c: In function 'vmx_save_host_state': arch/x86/kvm/vmx.c:2175:6: error: unused variable 'cpu' [-Werror=unused-variable] This puts it into another #ifdef. Fixes: 35060ed6a1ff ("x86/kvm/vmx: avoid expensive rdmsr for MSR_GS_BASE") Signed-off-by: Arnd Bergmann Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 39a83a66a282..939c8724feb4 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2351,7 +2351,9 @@ static unsigned long segment_base(u16 selector) static void vmx_save_host_state(struct kvm_vcpu *vcpu) { struct vcpu_vmx *vmx = to_vmx(vcpu); +#ifdef CONFIG_X86_64 int cpu = raw_smp_processor_id(); +#endif int i; if (vmx->host_state.loaded)