Commit 6ae9c84f authored by Philipp Zabel's avatar Philipp Zabel Committed by Lucas Stach

drm/etnaviv: mmuv2: use memset32 to init scratch page

Replace the open-coded scratch page initialization loop with memset32
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent 9d3cce1e
...@@ -119,8 +119,7 @@ static size_t etnaviv_iommuv2_unmap(struct etnaviv_iommu_domain *domain, ...@@ -119,8 +119,7 @@ static size_t etnaviv_iommuv2_unmap(struct etnaviv_iommu_domain *domain,
static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain) static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain)
{ {
u32 *p; int ret;
int ret, i;
/* allocate scratch page */ /* allocate scratch page */
etnaviv_domain->base.bad_page_cpu = etnaviv_domain->base.bad_page_cpu =
...@@ -131,9 +130,9 @@ static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain) ...@@ -131,9 +130,9 @@ static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain)
ret = -ENOMEM; ret = -ENOMEM;
goto fail_mem; goto fail_mem;
} }
p = etnaviv_domain->base.bad_page_cpu;
for (i = 0; i < SZ_4K / 4; i++) memset32(etnaviv_domain->base.bad_page_cpu, 0xdead55aa,
*p++ = 0xdead55aa; SZ_4K / sizeof(u32));
etnaviv_domain->pta_cpu = dma_alloc_wc(etnaviv_domain->base.dev, etnaviv_domain->pta_cpu = dma_alloc_wc(etnaviv_domain->base.dev,
SZ_4K, &etnaviv_domain->pta_dma, SZ_4K, &etnaviv_domain->pta_dma,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment