Commit 9b964f16 authored by Wang Hai's avatar Wang Hai Committed by David S. Miller
Browse files

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: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8cf7d03
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1024,7 +1024,7 @@ 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,
	desc = dma_alloc_coherent(priv->dev,
				  TX_DESC_NUM * sizeof(struct sg_desc),
				  &phys_addr, GFP_KERNEL);
	if (!desc)