net: hns3: Add unlikely for dma_mapping_error check
authorJian Shen <shenjian15@huawei.com>
Fri, 21 Sep 2018 15:41:44 +0000 (16:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Sep 2018 02:29:32 +0000 (19:29 -0700)
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>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 73b42d3326ad971db65d574279f0f7614f4a10cf..8b637077642d71ed6817b6ac7844118d5ad8c482 100644 (file)
@@ -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;