summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
diff options
context:
space:
mode:
authorWang Hai <wanghai38@huawei.com>2020-07-24 16:46:30 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-25 03:28:51 +0300
commit9b964f16546167fd1d5dfcf4d66f5cc9bf608525 (patch)
treec7bf2f52943799813803abd752ea4706e432363b /drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
parenta8cf7d03319eca9abfb5d890283be0de2e692179 (diff)
downloadlinux-9b964f16546167fd1d5dfcf4d66f5cc9bf608525.tar.xz
net: hix5hd2_gmac: Remove unneeded cast from memory allocation
Remove casting the values returned by memory allocation function. Coccinelle emits WARNING: ./drivers/net/ethernet/hisilicon/hix5hd2_gmac.c:1027:9-23: WARNING: casting value returned by memory allocation function to (struct sg_desc *) is useless. This issue was detected by using the Coccinelle software. Signed-off-by: Wang Hai <wanghai38@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hix5hd2_gmac.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hix5hd2_gmac.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index 4fb776920a93..8b2bf85039f1 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -1024,9 +1024,9 @@ static int hix5hd2_init_sg_desc_queue(struct hix5hd2_priv *priv)
struct sg_desc *desc;
dma_addr_t phys_addr;
- desc = (struct sg_desc *)dma_alloc_coherent(priv->dev,
- TX_DESC_NUM * sizeof(struct sg_desc),
- &phys_addr, GFP_KERNEL);
+ desc = dma_alloc_coherent(priv->dev,
+ TX_DESC_NUM * sizeof(struct sg_desc),
+ &phys_addr, GFP_KERNEL);
if (!desc)
return -ENOMEM;