diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-04-02 13:52:48 +0200 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-04-02 13:52:48 +0200 |
commit | 5d9428de1a9785f10a4339f80b717be665ba51c7 (patch) | |
tree | 27eeed8a87ef248cec694032463f0d8f3b38fbcc /drivers/net/tg3.c | |
parent | BUG_ON() Conversion in drivers/s390/net/lcs.c (diff) | |
download | linux-5d9428de1a9785f10a4339f80b717be665ba51c7.tar.xz linux-5d9428de1a9785f10a4339f80b717be665ba51c7.zip |
BUG_ON() Conversion in drivers/net/
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r-- | drivers/net/tg3.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 964c09644832..46f55fb9a053 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -2966,9 +2966,7 @@ static void tg3_tx(struct tg3 *tp) struct sk_buff *skb = ri->skb; int i; - if (unlikely(skb == NULL)) - BUG(); - + BUG_ON(skb == NULL); pci_unmap_single(tp->pdev, pci_unmap_addr(ri, mapping), skb_headlen(skb), @@ -2979,12 +2977,10 @@ static void tg3_tx(struct tg3 *tp) sw_idx = NEXT_TX(sw_idx); for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { - if (unlikely(sw_idx == hw_idx)) - BUG(); + BUG_ON(sw_idx == hw_idx); ri = &tp->tx_buffers[sw_idx]; - if (unlikely(ri->skb != NULL)) - BUG(); + BUG_ON(ri->skb != NULL); pci_unmap_page(tp->pdev, pci_unmap_addr(ri, mapping), @@ -4935,9 +4931,8 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset) { int i; - if (offset == TX_CPU_BASE && - (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) - BUG(); + BUG_ON(offset == TX_CPU_BASE && + (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)); if (offset == RX_CPU_BASE) { for (i = 0; i < 10000; i++) { |