Skip to content

Commit

Permalink
net: hns3: Add unlikely for dma_mapping_error check
Browse files Browse the repository at this point in the history
For dma_mapping_error is unlikely happened, this patch adds unlikely for
dma_mapping_error check.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
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>
  • Loading branch information
Jian Shen authored and David S. Miller committed Sep 22, 2018
1 parent 7a81011 commit 2211f4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,7 +1807,7 @@ static int hns3_map_buffer(struct hns3_enet_ring *ring, struct hns3_desc_cb *cb)
cb->dma = dma_map_page(ring_to_dev(ring), cb->priv, 0,
cb->length, ring_to_dma_dir(ring));

if (dma_mapping_error(ring_to_dev(ring), cb->dma))
if (unlikely(dma_mapping_error(ring_to_dev(ring), cb->dma)))
return -EIO;

return 0;
Expand Down

0 comments on commit 2211f4e

Please sign in to comment.