summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBinbin Wu <binbin.wu@linux.intel.com>2023-03-22 07:58:24 +0300
committerSean Christopherson <seanjc@google.com>2023-03-23 01:44:33 +0300
commit68f7c82ab1b8c7057b0c241907ff7906c7407e6d (patch)
tree6f73801cb5939b8c745376b9d1912d6ffe154e8b
parent627778bfcfa1ff81acfe863dcc4316edd0a51276 (diff)
downloadlinux-68f7c82ab1b8c7057b0c241907ff7906c7407e6d.tar.xz
KVM: x86: Change return type of is_long_mode() to bool
Change return type of is_long_mode() to bool to avoid implicit cast, as literally every user of is_long_mode() treats its return value as a boolean. Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com> Link: https://lore.kernel.org/r/20230322045824.22970-5-binbin.wu@linux.intel.com Reviewed-by: Kai Huang <kai.huang@intel.com> Signed-off-by: Sean Christopherson <seanjc@google.com>
-rw-r--r--arch/x86/kvm/x86.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 577b82358529..203fb6640b5b 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -126,12 +126,12 @@ static inline bool is_protmode(struct kvm_vcpu *vcpu)
return kvm_is_cr0_bit_set(vcpu, X86_CR0_PE);
}
-static inline int is_long_mode(struct kvm_vcpu *vcpu)
+static inline bool is_long_mode(struct kvm_vcpu *vcpu)
{
#ifdef CONFIG_X86_64
- return vcpu->arch.efer & EFER_LMA;
+ return !!(vcpu->arch.efer & EFER_LMA);
#else
- return 0;
+ return false;
#endif
}