[PATCH] arm: it's OK to pass pointer to volatile as iounmap() argument...
[powerpc.git] / arch / arm / mm / ioremap.c
index dba7ddd..4654405 100644 (file)
@@ -177,7 +177,7 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
                         * Free the page table, if there was one.
                         */
                        if ((pmd_val(pmd) & PMD_TYPE_MASK) == PMD_TYPE_TABLE)
-                               pte_free_kernel(pmd_page_kernel(pmd));
+                               pte_free_kernel(pmd_page_vaddr(pmd));
                }
 
                addr += PGDIR_SIZE;
@@ -361,12 +361,14 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags)
 }
 EXPORT_SYMBOL(__ioremap);
 
-void __iounmap(void __iomem *addr)
+void __iounmap(volatile void __iomem *addr)
 {
+#ifndef CONFIG_SMP
        struct vm_struct **p, *tmp;
+#endif
        unsigned int section_mapping = 0;
 
-       addr = (void __iomem *)(PAGE_MASK & (unsigned long)addr);
+       addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long)addr);
 
 #ifndef CONFIG_SMP
        /*
@@ -393,6 +395,6 @@ void __iounmap(void __iomem *addr)
 #endif
 
        if (!section_mapping)
-               vunmap(addr);
+               vunmap((void __force *)addr);
 }
 EXPORT_SYMBOL(__iounmap);