From: Jian Shen Date: Fri, 21 Sep 2018 15:41:44 +0000 (+0100) Subject: net: hns3: Add unlikely for dma_mapping_error check X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2211f4e1955f11df5fe8df24f5eeda5a5bbe6748;p=openwrt%2Fstaging%2Fblogic.git net: hns3: Add unlikely for dma_mapping_error check For dma_mapping_error is unlikely happened, this patch adds unlikely for dma_mapping_error check. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 73b42d3326ad..8b637077642d 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -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;