Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wang Hai and committed by
David S. Miller
9b964f16 a8cf7d03

+3 -3
+3 -3
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
··· 1024 1024 struct sg_desc *desc; 1025 1025 dma_addr_t phys_addr; 1026 1026 1027 - desc = (struct sg_desc *)dma_alloc_coherent(priv->dev, 1028 - TX_DESC_NUM * sizeof(struct sg_desc), 1029 - &phys_addr, GFP_KERNEL); 1027 + desc = dma_alloc_coherent(priv->dev, 1028 + TX_DESC_NUM * sizeof(struct sg_desc), 1029 + &phys_addr, GFP_KERNEL); 1030 1030 if (!desc) 1031 1031 return -ENOMEM; 1032 1032