提交 932d1252 编写于 作者: P Peng Li 提交者: David S. Miller

net: hns3: Add unlikely for buf_num check

This patch adds unlikely for buf_num check.
Signed-off-by: NPeng Li <lipeng321@huawei.com>
Signed-off-by: NSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 874bff0b
......@@ -1074,7 +1074,7 @@ static int hns3_nic_maybe_stop_tx(struct sk_buff **out_skb, int *bnum,
/* No. of segments (plus a header) */
buf_num = skb_shinfo(skb)->nr_frags + 1;
if (buf_num > ring_space(ring))
if (unlikely(ring_space(ring) < buf_num))
return -EBUSY;
*bnum = buf_num;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册