diff options
author | Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> | 2008-07-26 00:40:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-26 00:40:45 -0400 |
commit | 53e5e96ec18da6f65e89f05674711e1c93d8df67 (patch) | |
tree | 4e88faaf8fdbb0ffee8a7937aa8846472f6a4405 /drivers/net/bnx2x_main.c | |
parent | 7d7e5a60c62e88cb8782760bb6c4d3bd1577a6c6 (diff) |
drivers/net: convert BUG_TRAP to generic WARN_ON
Removes legacy reinvent-the-wheel type thing. The generic
machinery integrates much better to automated debugging aids
such as kerneloops.org (and others), and is unambiguous due to
better naming. Non-intuively BUG_TRAP() is actually equal to
WARN_ON() rather than BUG_ON().
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x_main.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 0263bef9cc6d..93c95037c193 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -814,7 +814,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
814 | } | 814 | } |
815 | 815 | ||
816 | /* release skb */ | 816 | /* release skb */ |
817 | BUG_TRAP(skb); | 817 | WARN_ON(!skb); |
818 | dev_kfree_skb(skb); | 818 | dev_kfree_skb(skb); |
819 | tx_buf->first_bd = 0; | 819 | tx_buf->first_bd = 0; |
820 | tx_buf->skb = NULL; | 820 | tx_buf->skb = NULL; |
@@ -837,9 +837,9 @@ static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp) | |||
837 | used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS; | 837 | used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS; |
838 | 838 | ||
839 | #ifdef BNX2X_STOP_ON_ERROR | 839 | #ifdef BNX2X_STOP_ON_ERROR |
840 | BUG_TRAP(used >= 0); | 840 | WARN_ON(used < 0); |
841 | BUG_TRAP(used <= fp->bp->tx_ring_size); | 841 | WARN_ON(used > fp->bp->tx_ring_size); |
842 | BUG_TRAP((fp->bp->tx_ring_size - used) <= MAX_TX_AVAIL); | 842 | WARN_ON((fp->bp->tx_ring_size - used) > MAX_TX_AVAIL); |
843 | #endif | 843 | #endif |
844 | 844 | ||
845 | return (s16)(fp->bp->tx_ring_size) - used; | 845 | return (s16)(fp->bp->tx_ring_size) - used; |
@@ -4374,7 +4374,7 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) | |||
4374 | } | 4374 | } |
4375 | ring_prod = NEXT_RX_IDX(ring_prod); | 4375 | ring_prod = NEXT_RX_IDX(ring_prod); |
4376 | cqe_ring_prod = NEXT_RCQ_IDX(cqe_ring_prod); | 4376 | cqe_ring_prod = NEXT_RCQ_IDX(cqe_ring_prod); |
4377 | BUG_TRAP(ring_prod > i); | 4377 | WARN_ON(ring_prod <= i); |
4378 | } | 4378 | } |
4379 | 4379 | ||
4380 | fp->rx_bd_prod = ring_prod; | 4380 | fp->rx_bd_prod = ring_prod; |