Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1907e53 authored by YueHaibing's avatar YueHaibing Committed by David S. Miller
Browse files

net: hix5hd2_gmac: use dma_zalloc_coherent instead of allocator/memset



Use dma_zalloc_coherent instead of dma_alloc_coherent
followed by memset 0.

Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e064cce1
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1006,12 +1006,11 @@ static int hix5hd2_init_hw_desc_queue(struct hix5hd2_priv *priv)

	for (i = 0; i < QUEUE_NUMS; i++) {
		size = priv->pool[i].count * sizeof(struct hix5hd2_desc);
		virt_addr = dma_alloc_coherent(dev, size, &phys_addr,
		virt_addr = dma_zalloc_coherent(dev, size, &phys_addr,
						GFP_KERNEL);
		if (virt_addr == NULL)
			goto error_free_pool;

		memset(virt_addr, 0, size);
		priv->pool[i].size = size;
		priv->pool[i].desc = virt_addr;
		priv->pool[i].phys_addr = phys_addr;