On 25.08.21 08:22, CGEL wrote: > From: Jing Yangyang > > Use BUG_ON instead of a if condition followed by BUG. > > Generated by: scripts/coccinelle/misc/bugon.cocci > > Reported-by: Zeal Robot > Signed-off-by: Jing Yangyang 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); >