提交 53e5e96e 编写于 作者: I Ilpo Järvinen 提交者: David S. Miller

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: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7d7e5a60
...@@ -814,7 +814,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fastpath *fp, ...@@ -814,7 +814,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fastpath *fp,
} }
/* release skb */ /* release skb */
BUG_TRAP(skb); WARN_ON(!skb);
dev_kfree_skb(skb); dev_kfree_skb(skb);
tx_buf->first_bd = 0; tx_buf->first_bd = 0;
tx_buf->skb = NULL; tx_buf->skb = NULL;
...@@ -837,9 +837,9 @@ static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp) ...@@ -837,9 +837,9 @@ static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp)
used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS; used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS;
#ifdef BNX2X_STOP_ON_ERROR #ifdef BNX2X_STOP_ON_ERROR
BUG_TRAP(used >= 0); WARN_ON(used < 0);
BUG_TRAP(used <= fp->bp->tx_ring_size); WARN_ON(used > fp->bp->tx_ring_size);
BUG_TRAP((fp->bp->tx_ring_size - used) <= MAX_TX_AVAIL); WARN_ON((fp->bp->tx_ring_size - used) > MAX_TX_AVAIL);
#endif #endif
return (s16)(fp->bp->tx_ring_size) - used; return (s16)(fp->bp->tx_ring_size) - used;
...@@ -4374,7 +4374,7 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) ...@@ -4374,7 +4374,7 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp)
} }
ring_prod = NEXT_RX_IDX(ring_prod); ring_prod = NEXT_RX_IDX(ring_prod);
cqe_ring_prod = NEXT_RCQ_IDX(cqe_ring_prod); cqe_ring_prod = NEXT_RCQ_IDX(cqe_ring_prod);
BUG_TRAP(ring_prod > i); WARN_ON(ring_prod <= i);
} }
fp->rx_bd_prod = ring_prod; fp->rx_bd_prod = ring_prod;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册