drm/etnaviv: mmuv2: use memset32 to init scratch page
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 15 May 2018 14:09:15 +0000 (16:09 +0200)
committerLucas Stach <l.stach@pengutronix.de>
Mon, 6 Aug 2018 13:23:50 +0000 (15:23 +0200)
Replace the open-coded scratch page initialization loop with memset32

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
drivers/gpu/drm/etnaviv/etnaviv_iommu_v2.c

index 71fbc1f96cb63d6563284f26e7ec72cbf2cea9b6..f1c88d8ad5ba880fefbd123c74986ce6154713af 100644 (file)
@@ -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)
 {
-       u32 *p;
-       int ret, i;
+       int ret;
 
        /* allocate scratch page */
        etnaviv_domain->base.bad_page_cpu =
@@ -131,9 +130,9 @@ static int etnaviv_iommuv2_init(struct etnaviv_iommuv2_domain *etnaviv_domain)
                ret = -ENOMEM;
                goto fail_mem;
        }
-       p = etnaviv_domain->base.bad_page_cpu;
-       for (i = 0; i < SZ_4K / 4; i++)
-               *p++ = 0xdead55aa;
+
+       memset32(etnaviv_domain->base.bad_page_cpu, 0xdead55aa,
+                SZ_4K / sizeof(u32));
 
        etnaviv_domain->pta_cpu = dma_alloc_wc(etnaviv_domain->base.dev,
                                               SZ_4K, &etnaviv_domain->pta_dma,