All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: CGEL <cgel.zte@gmail.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Wei Liu <wei.liu@kernel.org>, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	Jing Yangyang <jing.yangyang@zte.com.cn>,
	Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH linux-next] drivers/xen/events/events_base.c: fix bugon.cocci warnings
Date: Wed, 25 Aug 2021 14:53:26 +0200	[thread overview]
Message-ID: <1dca78e6-a75c-4918-f901-23b5cec777fe@suse.com> (raw)
In-Reply-To: <20210825062222.69936-1-deng.changcheng@zte.com.cn>


[-- Attachment #1.1.1: Type: text/plain, Size: 2806 bytes --]

On 25.08.21 08:22, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Use BUG_ON instead of a if condition followed by BUG.
> 
> Generated by: scripts/coccinelle/misc/bugon.cocci
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>

I already gave you feedback for another patch asking you to adjust
the continuation line indentations.

Same here.


Juergen

> ---
>   drivers/xen/events/events_base.c | 21 ++++++++-------------
>   1 file changed, 8 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
> index a78704a..dd44019 100644
> --- a/drivers/xen/events/events_base.c
> +++ b/drivers/xen/events/events_base.c
> @@ -818,8 +818,7 @@ static void xen_evtchn_close(evtchn_port_t port)
>   	struct evtchn_close close;
>   
>   	close.port = port;
> -	if (HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0)
> -		BUG();
> +	BUG_ON(HYPERVISOR_event_channel_op(EVTCHNOP_close, &close) != 0);
>   }
>   
>   /* Not called for lateeoi events. */
> @@ -1270,9 +1269,8 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu)
>   					      handle_percpu_irq, "ipi");
>   
>   		bind_ipi.vcpu = xen_vcpu_nr(cpu);
> -		if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
> -						&bind_ipi) != 0)
> -			BUG();
> +		BUG_ON(HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
> +						&bind_ipi) != 0);
>   		evtchn = bind_ipi.port;
>   
>   		ret = xen_irq_info_ipi_setup(cpu, irq, evtchn, ipi);
> @@ -1983,9 +1981,8 @@ static void restore_cpu_virqs(unsigned int cpu)
>   		/* Get a new binding from Xen. */
>   		bind_virq.virq = virq;
>   		bind_virq.vcpu = xen_vcpu_nr(cpu);
> -		if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
> -						&bind_virq) != 0)
> -			BUG();
> +		BUG_ON(HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq,
> +						&bind_virq) != 0);
>   		evtchn = bind_virq.port;
>   
>   		/* Record the new mapping. */
> @@ -2009,9 +2006,8 @@ static void restore_cpu_ipis(unsigned int cpu)
>   
>   		/* Get a new binding from Xen. */
>   		bind_ipi.vcpu = xen_vcpu_nr(cpu);
> -		if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
> -						&bind_ipi) != 0)
> -			BUG();
> +		BUG_ON(HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi,
> +						&bind_ipi) != 0);
>   		evtchn = bind_ipi.port;
>   
>   		/* Record the new mapping. */
> @@ -2063,8 +2059,7 @@ void xen_poll_irq_timeout(int irq, u64 timeout)
>   		poll.timeout = timeout;
>   		set_xen_guest_handle(poll.ports, &evtchn);
>   
> -		if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0)
> -			BUG();
> +		BUG_ON(HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0);
>   	}
>   }
>   EXPORT_SYMBOL(xen_poll_irq_timeout);
> 


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

      reply	other threads:[~2021-08-25 12:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  6:22 [PATCH linux-next] drivers/xen/events/events_base.c: fix bugon.cocci warnings CGEL
2021-08-25 12:53 ` Juergen Gross [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1dca78e6-a75c-4918-f901-23b5cec777fe@suse.com \
    --to=jgross@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=cgel.zte@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=jing.yangyang@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=wei.liu@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zealci@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.