powerpc/mm: move ioremap_prot() into ioremap.c
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 20 Aug 2019 14:07:15 +0000 (14:07 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 27 Aug 2019 03:03:34 +0000 (13:03 +1000)
Both ioremap_prot() are idenfical, move them into ioremap.c

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/0b3eb0e0f1490a99fd6c983e166fb8946233f151.1566309262.git.christophe.leroy@c-s.fr
arch/powerpc/mm/ioremap.c
arch/powerpc/mm/pgtable_32.c
arch/powerpc/mm/pgtable_64.c

index 7f1d462e7745108fa1279b1475fc59252a649f2f..3d388aaa3ee6696768074f883b60566709c67508 100644 (file)
@@ -34,3 +34,22 @@ void __iomem *ioremap_coherent(phys_addr_t addr, unsigned long size)
                return iowa_ioremap(addr, size, prot, caller);
        return __ioremap_caller(addr, size, prot, caller);
 }
+
+void __iomem *ioremap_prot(phys_addr_t addr, unsigned long size, unsigned long flags)
+{
+       pte_t pte = __pte(flags);
+       void *caller = __builtin_return_address(0);
+
+       /* writeable implies dirty for kernel addresses */
+       if (pte_write(pte))
+               pte = pte_mkdirty(pte);
+
+       /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
+       pte = pte_exprotect(pte);
+       pte = pte_mkprivileged(pte);
+
+       if (iowa_is_active())
+               return iowa_ioremap(addr, size, pte_pgprot(pte), caller);
+       return __ioremap_caller(addr, size, pte_pgprot(pte), caller);
+}
+EXPORT_SYMBOL(ioremap_prot);
index a363d87d0a9dc0ebcaba4b731e865704b779ddd7..ac5a267467faa53b1235d6c9e063924f92df56d9 100644 (file)
@@ -47,23 +47,6 @@ ioremap_wt(phys_addr_t addr, unsigned long size)
 }
 EXPORT_SYMBOL(ioremap_wt);
 
-void __iomem *
-ioremap_prot(phys_addr_t addr, unsigned long size, unsigned long flags)
-{
-       pte_t pte = __pte(flags);
-
-       /* writeable implies dirty for kernel addresses */
-       if (pte_write(pte))
-               pte = pte_mkdirty(pte);
-
-       /* we don't want to let _PAGE_USER and _PAGE_EXEC leak out */
-       pte = pte_exprotect(pte);
-       pte = pte_mkprivileged(pte);
-
-       return __ioremap_caller(addr, size, pte_pgprot(pte), __builtin_return_address(0));
-}
-EXPORT_SYMBOL(ioremap_prot);
-
 void __iomem *
 __ioremap_caller(phys_addr_t addr, unsigned long size, pgprot_t prot, void *caller)
 {
index 358233ea8d859406e3f01e9c0c06b512d7a9ec06..2b9078e1bc43a513b49072e93bb0dedd9d3c5da8 100644 (file)
@@ -203,29 +203,6 @@ void __iomem * __ioremap_caller(phys_addr_t addr, unsigned long size,
        return ret;
 }
 
-void __iomem * ioremap_prot(phys_addr_t addr, unsigned long size,
-                            unsigned long flags)
-{
-       pte_t pte = __pte(flags);
-       void *caller = __builtin_return_address(0);
-
-       /* writeable implies dirty for kernel addresses */
-       if (pte_write(pte))
-               pte = pte_mkdirty(pte);
-
-       /* we don't want to let _PAGE_EXEC leak out */
-       pte = pte_exprotect(pte);
-       /*
-        * Force kernel mapping.
-        */
-       pte = pte_mkprivileged(pte);
-
-       if (iowa_is_active())
-               return iowa_ioremap(addr, size, pte_pgprot(pte), caller);
-       return __ioremap_caller(addr, size, pte_pgprot(pte), caller);
-}
-
-
 /*  
  * Unmap an IO region and remove it from imalloc'd list.
  * Access to IO memory should be serialized by driver.
@@ -247,7 +224,6 @@ void iounmap(volatile void __iomem *token)
        vunmap(addr);
 }
 
-EXPORT_SYMBOL(ioremap_prot);
 EXPORT_SYMBOL(__ioremap_at);
 EXPORT_SYMBOL(iounmap);
 EXPORT_SYMBOL(__iounmap_at);