aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPeng Li <lipeng321@huawei.com>2018-09-19 18:29:48 +0100
committerDavid S. Miller <davem@davemloft.net>2018-09-19 21:20:22 -0700
commit932d1252aded755bfd6f53183ab6211f711c6435 (patch)
tree2f8de9dc64ca05932079ac9194bd11a07309d0d5 /drivers
parentnet: hns3: Add default irq affinity (diff)
downloadlinux-dev-932d1252aded755bfd6f53183ab6211f711c6435.tar.xz
linux-dev-932d1252aded755bfd6f53183ab6211f711c6435.zip
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 052b7fbf1803..837c6d62c29f 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -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;