Skip to content

Commit 68f7c82

Browse files
Binbin Wusean-jc
authored andcommitted
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>
1 parent 627778b commit 68f7c82

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/x86/kvm/x86.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ static inline bool is_protmode(struct kvm_vcpu *vcpu)
126126
return kvm_is_cr0_bit_set(vcpu, X86_CR0_PE);
127127
}
128128

129-
static inline int is_long_mode(struct kvm_vcpu *vcpu)
129+
static inline bool is_long_mode(struct kvm_vcpu *vcpu)
130130
{
131131
#ifdef CONFIG_X86_64
132-
return vcpu->arch.efer & EFER_LMA;
132+
return !!(vcpu->arch.efer & EFER_LMA);
133133
#else
134-
return 0;
134+
return false;
135135
#endif
136136
}
137137

0 commit comments

Comments
 (0)