diff options
author | Gustavo A. R. Silva <garsilva@embeddedor.com> | 2017-10-26 14:16:01 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-27 16:52:36 +0200 |
commit | 4fa112f6b5fb055478e76f2b446673565d2ea35f (patch) | |
tree | fc21233f71eb6188dda6c97f3a4396a0512a2b22 | |
parent | Merge branch 'cxgb4-collect-more-hardware-dumps-via-ethtool' (diff) | |
download | linux-4fa112f6b5fb055478e76f2b446673565d2ea35f.tar.xz linux-4fa112f6b5fb055478e76f2b446673565d2ea35f.zip |
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: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 9713374ebf14..24b4f4ceceef 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -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++) { tx_cb_ptr = bcmgenet_get_txcb(priv, ring); - if (unlikely(!tx_cb_ptr)) - BUG(); + BUG_ON(!tx_cb_ptr); if (!i) { /* Transmit single SKB or head of fragment list */ |