Commit 5bca178e authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by David S. Miller

net: faraday: ftmac100: Use BUG_ON instead of if condition followed by BUG.

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

This issue was detected with the help of Coccinelle.
Signed-off-by: default avatarGustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4fa112f6
...@@ -402,6 +402,7 @@ static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed) ...@@ -402,6 +402,7 @@ static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed)
struct page *page; struct page *page;
dma_addr_t map; dma_addr_t map;
int length; int length;
bool ret;
rxdes = ftmac100_rx_locate_first_segment(priv); rxdes = ftmac100_rx_locate_first_segment(priv);
if (!rxdes) if (!rxdes)
...@@ -416,8 +417,8 @@ static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed) ...@@ -416,8 +417,8 @@ static bool ftmac100_rx_packet(struct ftmac100 *priv, int *processed)
* It is impossible to get multi-segment packets * It is impossible to get multi-segment packets
* because we always provide big enough receive buffers. * because we always provide big enough receive buffers.
*/ */
if (unlikely(!ftmac100_rxdes_last_segment(rxdes))) ret = ftmac100_rxdes_last_segment(rxdes);
BUG(); BUG_ON(!ret);
/* start processing */ /* start processing */
skb = netdev_alloc_skb_ip_align(netdev, 128); skb = netdev_alloc_skb_ip_align(netdev, 128);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment