]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: x86: Clean up: remove redundant bool conversions
authorMichal Luczaj <mhal@rbox.co>
Mon, 5 Jun 2023 20:01:21 +0000 (22:01 +0200)
committerSean Christopherson <seanjc@google.com>
Wed, 7 Jun 2023 00:13:55 +0000 (17:13 -0700)
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>
arch/x86/kvm/svm/svm.c
arch/x86/kvm/x86.c

index 924609d63f8adecf042b5f8d336a2669aebfad0c..02183ebc0e16e2cb6cd785807b6085472a45cf3b 100644 (file)
@@ -752,7 +752,7 @@ static bool msr_write_intercepted(struct kvm_vcpu *vcpu, u32 msr)
 
        BUG_ON(offset == MSR_INVALID);
 
-       return !!test_bit(bit_write,  &tmp);
+       return test_bit(bit_write, &tmp);
 }
 
 static void set_msr_interception_bitmap(struct kvm_vcpu *vcpu, u32 *msrpm,
index 6f461afed8008612175542b8b27d16cea6669802..355f3df8dbadc2d263c38ceff8d4d1ac807d5896 100644 (file)
@@ -1805,7 +1805,7 @@ bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type)
                unsigned long *bitmap = ranges[i].bitmap;
 
                if ((index >= start) && (index < end) && (flags & type)) {
-                       allowed = !!test_bit(index - start, bitmap);
+                       allowed = test_bit(index - start, bitmap);
                        break;
                }
        }