[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1dca78e6-a75c-4918-f901-23b5cec777fe@suse.com>
Date: Wed, 25 Aug 2021 14:53:26 +0200
From: Juergen Gross <jgross@...e.com>
To: CGEL <cgel.zte@...il.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>
Cc: Stefano Stabellini <sstabellini@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Wei Liu <wei.liu@...nel.org>, Jan Beulich <jbeulich@...e.com>,
xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
Jing Yangyang <jing.yangyang@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] drivers/xen/events/events_base.c: fix
bugon.cocci warnings
On 25.08.21 08:22, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@....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@....com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@....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);
>
Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3092 bytes)
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)
Powered by blists - more mailing lists