Commit 932d1252 authored by Peng Li's avatar Peng Li Committed by David S. Miller

net: hns3: Add unlikely for buf_num check

This patch adds unlikely for buf_num check.
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 874bff0b
...@@ -1074,7 +1074,7 @@ static int hns3_nic_maybe_stop_tx(struct sk_buff **out_skb, int *bnum, ...@@ -1074,7 +1074,7 @@ static int hns3_nic_maybe_stop_tx(struct sk_buff **out_skb, int *bnum,
/* No. of segments (plus a header) */ /* No. of segments (plus a header) */
buf_num = skb_shinfo(skb)->nr_frags + 1; buf_num = skb_shinfo(skb)->nr_frags + 1;
if (buf_num > ring_space(ring)) if (unlikely(ring_space(ring) < buf_num))
return -EBUSY; return -EBUSY;
*bnum = buf_num; *bnum = buf_num;
......
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