mirror of
https://github.com/torvalds/linux.git
synced 2024-12-30 14:52:05 +00:00
net: hns3: Add unlikely for buf_num check
This patch adds unlikely for buf_num check. Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
874bff0ba6
commit
932d1252ad
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user