提交 4fa112f6 编写于 作者: G Gustavo A. R. Silva 提交者: David S. Miller

net: bcmgenet: Use BUG_ON instead of if condition followed by BUG

Use BUG_ON instead of if condition followed by BUG.

Something to notice in this particular case is that unlikely()
is already being called inside BUG_ON macro.

This issue was detected with the help of Coccinelle.
Signed-off-by: NGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 42c8ae11
...@@ -1580,8 +1580,7 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1580,8 +1580,7 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
for (i = 0; i <= nr_frags; i++) { for (i = 0; i <= nr_frags; i++) {
tx_cb_ptr = bcmgenet_get_txcb(priv, ring); tx_cb_ptr = bcmgenet_get_txcb(priv, ring);
if (unlikely(!tx_cb_ptr)) BUG_ON(!tx_cb_ptr);
BUG();
if (!i) { if (!i) {
/* Transmit single SKB or head of fragment list */ /* Transmit single SKB or head of fragment list */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册