mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: fix bugon.cocci warnings
@ 2019-09-29 16:43 Julia Lawall
  2019-10-09 11:07 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2019-09-29 16:43 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: kbuild-all, linux-kernel, Paolo Bonzini,
	Radim Krčmář,
	Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov

From: kbuild test robot <lkp@intel.com>

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 <sean.j.christopherson@intel.com>
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---

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(-)

--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: fix bugon.cocci warnings
  2019-09-29 16:43 [PATCH] KVM: x86: fix bugon.cocci warnings Julia Lawall
@ 2019-10-09 11:07 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2019-10-09 11:07 UTC (permalink / raw)
  To: Julia Lawall, Sean Christopherson
  Cc: kbuild-all, linux-kernel, Radim Krčmář,
	Vitaly Kuznetsov, Wanpeng Li, Jim Mattson, Joerg Roedel,
	Thomas Gleixner, Ingo Molnar, Borislav Petkov

On 29/09/19 18:43, Julia Lawall wrote:
> From: kbuild test robot <lkp@intel.com>
> 
> 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 <sean.j.christopherson@intel.com>
> Signed-off-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
> 
> 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(-)
> 
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-09 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-29 16:43 [PATCH] KVM: x86: fix bugon.cocci warnings Julia Lawall
2019-10-09 11:07 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®