KVM: x86: fix bugon.cocci warnings
PATCH 1/1 KVM: x86: fix bugon.cocci warnings
From: kbuild test robot <[email protected]>
Use BUG_ON instead of a if condition followed by BUG.
Generated by: scripts/coccinelle/misc/bugon.cocci
Fixes 4b526de50e39 ("KVM: x86: Check kvm_rebooting in kvm_spurious_fault()")
CC Sean Christopherson <[email protected]>
Signed-off-by kbuild test robot <[email protected]>
Signed-off-by Julia Lawall <[email protected]>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 02dc96ef6c25f990452c114c59d75c368a1f4c8f commit: 4b526de50e39b38cd828396267379183c7c21354 KVM: x86: Check kvm_rebooting in kvm_spurious_fault()
:::::: branch date: 9 hours ago
:::::: commit date: 4 days ago
Please take the patch only if it's a positive warning. Thanks!
x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/x86.c +1 -2
@@ -360,8 +360,7 @@ EXPORT_SYMBOL_GPL(kvm_set_apic_base); asmlinkage __visible void kvm_spurious_fault(void) {/* Fault while not rebooting. We want the trace. */ -if (!kvm_rebooting) -BUG (); +BUG_ON (!kvm_rebooting); }EXPORT_SYMBOL_GPL (kvm_spurious_fault);
Quoted 26 lines · Julia Lawall
From: kbuild test robot <[email protected]>
Use
BUG_ONinstead of a if condition followed by BUG.Generated by:
scripts/coccinelle/misc/bugon.cocciFixes 4b526de50e39 ("KVM: x86: Check kvm_rebooting in kvm_spurious_fault()")CC Sean Christopherson <[email protected]>Signed-off-by kbuild test robot <[email protected]>Signed-off-by Julia Lawall <[email protected]>---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 02dc96ef6c25f990452c114c59d75c368a1f4c8f commit: 4b526de50e39b38cd828396267379183c7c21354 KVM: x86: Check kvm_rebooting in kvm_spurious_fault():::::: branch date: 9 hours ago
:::::: commit date: 4 days agoPlease take the patch only if it's a positive warning. Thanks!
x86.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/kvm/x86.c EXPORT_SYMBOL_GPL(kvm_set_apic_base); · line 366
Quoted 9 lines
arch/x86/kvm/x86.c +1
-2@@ -360,8 +360,7 @@ EXPORT_SYMBOL_GPL(kvm_set_apic_base); asmlinkage __visible void kvm_spurious_fault(void) {/* Fault while not rebooting. We want the trace. */ -if (!kvm_rebooting) -BUG (); +BUG_ON (!kvm_rebooting); }EXPORT_SYMBOL_GPL (kvm_spurious_fault);
Queued, thanks!
Paolo