Commit 0fdc0d67 authored by Igor Stoppa's avatar Igor Stoppa Committed by David S. Miller

freescale: ethernet: remove unnecessary unlikely()

Both WARN_ON() and WARN_ONCE() already contain an unlikely(), so it's not
necessary to wrap it into another.
Signed-off-by: default avatarIgor Stoppa <igor.stoppa@huawei.com>
Cc: Madalin Bucur <madalin.bucur@nxp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 38bb4ac9
...@@ -1280,7 +1280,7 @@ static int dpaa_bman_release(const struct dpaa_bp *dpaa_bp, ...@@ -1280,7 +1280,7 @@ static int dpaa_bman_release(const struct dpaa_bp *dpaa_bp,
err = bman_release(dpaa_bp->pool, bmb, cnt); err = bman_release(dpaa_bp->pool, bmb, cnt);
/* Should never occur, address anyway to avoid leaking the buffers */ /* Should never occur, address anyway to avoid leaking the buffers */
if (unlikely(WARN_ON(err)) && dpaa_bp->free_buf_cb) if (WARN_ON(err) && dpaa_bp->free_buf_cb)
while (cnt-- > 0) while (cnt-- > 0)
dpaa_bp->free_buf_cb(dpaa_bp, &bmb[cnt]); dpaa_bp->free_buf_cb(dpaa_bp, &bmb[cnt]);
...@@ -1704,10 +1704,8 @@ static struct sk_buff *contig_fd_to_skb(const struct dpaa_priv *priv, ...@@ -1704,10 +1704,8 @@ static struct sk_buff *contig_fd_to_skb(const struct dpaa_priv *priv,
skb = build_skb(vaddr, dpaa_bp->size + skb = build_skb(vaddr, dpaa_bp->size +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info))); SKB_DATA_ALIGN(sizeof(struct skb_shared_info)));
if (unlikely(!skb)) { if (WARN_ONCE(!skb, "Build skb failure on Rx\n"))
WARN_ONCE(1, "Build skb failure on Rx\n");
goto free_buffer; goto free_buffer;
}
WARN_ON(fd_off != priv->rx_headroom); WARN_ON(fd_off != priv->rx_headroom);
skb_reserve(skb, fd_off); skb_reserve(skb, fd_off);
skb_put(skb, qm_fd_get_length(fd)); skb_put(skb, qm_fd_get_length(fd));
...@@ -1770,7 +1768,7 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv, ...@@ -1770,7 +1768,7 @@ static struct sk_buff *sg_fd_to_skb(const struct dpaa_priv *priv,
sz = dpaa_bp->size + sz = dpaa_bp->size +
SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
skb = build_skb(sg_vaddr, sz); skb = build_skb(sg_vaddr, sz);
if (WARN_ON(unlikely(!skb))) if (WARN_ON(!skb))
goto free_buffers; goto free_buffers;
skb->ip_summed = rx_csum_offload(priv, fd); skb->ip_summed = rx_csum_offload(priv, fd);
......
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