* [PATCH] usb: use BUG_ON() instead of BUG()
@ 2015-12-02 22:18 Geyslan G. Bem
2015-12-07 10:10 ` Peter Senna Tschudin
0 siblings, 1 reply; 2+ messages in thread
From: Geyslan G. Bem @ 2015-12-02 22:18 UTC (permalink / raw)
To: peter.senna
Cc: Geyslan G. Bem, Greg Kroah-Hartman, Sergei Shtylyov,
Julia Lawall, Saurabh Karajgaonkar, Rafael J. Wysocki,
Felipe Balbi, linux-usb, linux-kernel
Replace BUG() with BUG_ON().
Caught by coccinelle.
Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
drivers/usb/host/oxu210hp-hcd.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index 1f139d8..bc74aca 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -394,8 +394,7 @@ static void ehci_quiesce(struct oxu_hcd *oxu)
u32 temp;
#ifdef DEBUG
- if (!HC_IS_RUNNING(oxu_to_hcd(oxu)->state))
- BUG();
+ BUG_ON(!HC_IS_RUNNING(oxu_to_hcd(oxu)->state));
#endif
/* wait for any schedule enables/disables to take effect */
@@ -1709,9 +1708,8 @@ static void start_unlink_async(struct oxu_hcd *oxu, struct ehci_qh *qh)
#ifdef DEBUG
assert_spin_locked(&oxu->lock);
- if (oxu->reclaim || (qh->qh_state != QH_STATE_LINKED
- && qh->qh_state != QH_STATE_UNLINK_WAIT))
- BUG();
+ BUG_ON(oxu->reclaim || (qh->qh_state != QH_STATE_LINKED
+ && qh->qh_state != QH_STATE_UNLINK_WAIT));
#endif
/* stop async schedule right now? */
--
2.6.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: use BUG_ON() instead of BUG()
2015-12-02 22:18 [PATCH] usb: use BUG_ON() instead of BUG() Geyslan G. Bem
@ 2015-12-07 10:10 ` Peter Senna Tschudin
0 siblings, 0 replies; 2+ messages in thread
From: Peter Senna Tschudin @ 2015-12-07 10:10 UTC (permalink / raw)
To: Geyslan G. Bem
Cc: Greg Kroah-Hartman, Sergei Shtylyov, Julia Lawall,
Saurabh Karajgaonkar, Rafael J. Wysocki, Felipe Balbi, linux-usb,
linux-kernel
On Wed, Dec 2, 2015 at 11:18 PM, Geyslan G. Bem <geyslan@gmail.com> wrote:
> Replace BUG() with BUG_ON().
>
> Caught by coccinelle.
I would mention the path to the .cocci script, but other than that:
Acked-by: Peter Senna Tschudin <peter.senna@gmail.com>
>
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
> ---
> drivers/usb/host/oxu210hp-hcd.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
> index 1f139d8..bc74aca 100644
> --- a/drivers/usb/host/oxu210hp-hcd.c
> +++ b/drivers/usb/host/oxu210hp-hcd.c
> @@ -394,8 +394,7 @@ static void ehci_quiesce(struct oxu_hcd *oxu)
> u32 temp;
>
> #ifdef DEBUG
> - if (!HC_IS_RUNNING(oxu_to_hcd(oxu)->state))
> - BUG();
> + BUG_ON(!HC_IS_RUNNING(oxu_to_hcd(oxu)->state));
> #endif
>
> /* wait for any schedule enables/disables to take effect */
> @@ -1709,9 +1708,8 @@ static void start_unlink_async(struct oxu_hcd *oxu, struct ehci_qh *qh)
>
> #ifdef DEBUG
> assert_spin_locked(&oxu->lock);
> - if (oxu->reclaim || (qh->qh_state != QH_STATE_LINKED
> - && qh->qh_state != QH_STATE_UNLINK_WAIT))
> - BUG();
> + BUG_ON(oxu->reclaim || (qh->qh_state != QH_STATE_LINKED
> + && qh->qh_state != QH_STATE_UNLINK_WAIT));
> #endif
>
> /* stop async schedule right now? */
> --
> 2.6.3
>
--
Peter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-07 10:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 22:18 [PATCH] usb: use BUG_ON() instead of BUG() Geyslan G. Bem
2015-12-07 10:10 ` Peter Senna Tschudin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).