diff mbox series

KVM: x86: Clean up: remove redundant bool conversions

Message ID 20230605200158.118109-1-mhal@rbox.co (mailing list archive)
State New, archived
Headers show
Series KVM: x86: Clean up: remove redundant bool conversions | expand

Commit Message

Michal Luczaj June 5, 2023, 8:01 p.m. UTC
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>
---
 arch/x86/kvm/svm/svm.c | 2 +-
 arch/x86/kvm/x86.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Sean Christopherson June 7, 2023, 12:53 a.m. UTC | #1
On Mon, 05 Jun 2023 22:01:21 +0200, Michal Luczaj wrote:
> As test_bit() returns bool, explicitly converting result to bool is
> unnecessary. Get rid of '!!'.
> 
> No functional change intended.
> 
> 

Applied to kvm-x86 misc, thanks!

[1/1] KVM: x86: Clean up: remove redundant bool conversions
      https://github.com/kvm-x86/linux/commit/e12fa4b92a07

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes
diff mbox series

Patch

diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index aa0b90972376..4048938a9564 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -739,7 +739,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,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5ad55ef71433..4532b2e4b841 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1809,7 +1809,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;
 		}
 	}