summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Hao <flyingpeng@tencent.com>2022-12-06 10:20:15 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-12-23 18:09:28 +0100
commit3c649918b764c0aaef22ea65d514bac5e2324ec0 (patch)
tree374b512779d52a82f8e2671fe5325d1450d52858
parentKVM: x86: hyper-v: Fix 'using uninitialized value' Coverity warning (diff)
downloadlinux-3c649918b764c0aaef22ea65d514bac5e2324ec0.tar.xz
linux-3c649918b764c0aaef22ea65d514bac5e2324ec0.zip
KVM: x86: Simplify kvm_apic_hw_enabled
kvm_apic_hw_enabled() only needs to return bool, there is no place to use the return value of MSR_IA32_APICBASE_ENABLE. Signed-off-by: Peng Hao <flyingpeng@tencent.com> Message-Id: <CAPm50aJ=BLXNWT11+j36Dd6d7nz2JmOBk4u7o_NPQ0N61ODu1g@mail.gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/lapic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
index 28e3769066e2..58c3242fcc7a 100644
--- a/arch/x86/kvm/lapic.h
+++ b/arch/x86/kvm/lapic.h
@@ -188,11 +188,11 @@ static inline bool lapic_in_kernel(struct kvm_vcpu *vcpu)
extern struct static_key_false_deferred apic_hw_disabled;
-static inline int kvm_apic_hw_enabled(struct kvm_lapic *apic)
+static inline bool kvm_apic_hw_enabled(struct kvm_lapic *apic)
{
if (static_branch_unlikely(&apic_hw_disabled.key))
return apic->vcpu->arch.apic_base & MSR_IA32_APICBASE_ENABLE;
- return MSR_IA32_APICBASE_ENABLE;
+ return true;
}
extern struct static_key_false_deferred apic_sw_disabled;