Skip to content

Commit e12fa4b

Browse files
mmhalsean-jc
authored andcommitted
KVM: x86: Clean up: remove redundant bool conversions
As test_bit() returns bool, explicitly converting result to bool is unnecessary. Get rid of '!!'. No functional change intended. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Michal Luczaj <mhal@rbox.co> Link: https://lore.kernel.org/r/20230605200158.118109-1-mhal@rbox.co Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 056b991 commit e12fa4b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kvm/svm/svm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@ static bool msr_write_intercepted(struct kvm_vcpu *vcpu, u32 msr)
752752

753753
BUG_ON(offset == MSR_INVALID);
754754

755-
return !!test_bit(bit_write, &tmp);
755+
return test_bit(bit_write, &tmp);
756756
}
757757

758758
static void set_msr_interception_bitmap(struct kvm_vcpu *vcpu, u32 *msrpm,

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1805,7 +1805,7 @@ bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type)
18051805
unsigned long *bitmap = ranges[i].bitmap;
18061806

18071807
if ((index >= start) && (index < end) && (flags & type)) {
1808-
allowed = !!test_bit(index - start, bitmap);
1808+
allowed = test_bit(index - start, bitmap);
18091809
break;
18101810
}
18111811
}

0 commit comments

Comments
 (0)