Commit 68f7c82a authored by Binbin Wu's avatar Binbin Wu Committed by Sean Christopherson

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: default avatarBinbin Wu <binbin.wu@linux.intel.com>
Link: https://lore.kernel.org/r/20230322045824.22970-5-binbin.wu@linux.intel.comReviewed-by: default avatarKai Huang <kai.huang@intel.com>
Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent 627778bf
...@@ -126,12 +126,12 @@ static inline bool is_protmode(struct kvm_vcpu *vcpu) ...@@ -126,12 +126,12 @@ static inline bool is_protmode(struct kvm_vcpu *vcpu)
return kvm_is_cr0_bit_set(vcpu, X86_CR0_PE); 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 #ifdef CONFIG_X86_64
return vcpu->arch.efer & EFER_LMA; return !!(vcpu->arch.efer & EFER_LMA);
#else #else
return 0; return false;
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment