Commit 38b91f81 authored by Joerg Roedel's avatar Joerg Roedel
Browse files

iommu/sun50i: Use __GFP_ZERO instead of memset()



Allocate zeroed memory so there is no need to memset it to 0 in the
driver.

Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20200514124621.25999-2-joro@8bytes.org
parent ab785cfa
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -616,11 +616,10 @@ static struct iommu_domain *sun50i_iommu_domain_alloc(unsigned type)
	    iommu_get_dma_cookie(&sun50i_domain->domain))
	    iommu_get_dma_cookie(&sun50i_domain->domain))
		goto err_free_domain;
		goto err_free_domain;


	sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL,
	sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
						    get_order(DT_SIZE));
						    get_order(DT_SIZE));
	if (!sun50i_domain->dt)
	if (!sun50i_domain->dt)
		goto err_put_cookie;
		goto err_put_cookie;
	memset(sun50i_domain->dt, 0, DT_SIZE);


	refcount_set(&sun50i_domain->refcnt, 1);
	refcount_set(&sun50i_domain->refcnt, 1);