Skip to content

Commit 38b91f8

Browse files
committed
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: Joerg Roedel <[email protected]> Cc: Maxime Ripard <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent ab785cf commit 38b91f8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/iommu/sun50i-iommu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,10 @@ static struct iommu_domain *sun50i_iommu_domain_alloc(unsigned type)
616616
iommu_get_dma_cookie(&sun50i_domain->domain))
617617
goto err_free_domain;
618618

619-
sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL,
619+
sun50i_domain->dt = (u32 *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
620620
get_order(DT_SIZE));
621621
if (!sun50i_domain->dt)
622622
goto err_put_cookie;
623-
memset(sun50i_domain->dt, 0, DT_SIZE);
624623

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

0 commit comments

Comments
 (0)