ARM: Avoid evaluating page_address() multiple times
[linux-2.6-block.git] / arch / arm / mm / flush.c
index a480f161a4bb95aaaf7b775da7bbfa36e9f45701..43474d8752a6bd4909a0fff9c7a68a656ac5f423 100644 (file)
@@ -111,6 +111,8 @@ void flush_ptrace_access(struct vm_area_struct *vma, struct page *page,
 
 void __flush_dcache_page(struct address_space *mapping, struct page *page)
 {
+       void *addr = page_address(page);
+
        /*
         * Writeback any data associated with the kernel mapping of this
         * page.  This ensures that data in the physical page is mutually
@@ -121,9 +123,9 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)
         * kmap_atomic() doesn't set the page virtual address, and
         * kunmap_atomic() takes care of cache flushing already.
         */
-       if (page_address(page))
+       if (addr)
 #endif
-               __cpuc_flush_dcache_page(page_address(page));
+               __cpuc_flush_dcache_page(addr);
 
        /*
         * If this is a page cache page, and we have an aliasing VIPT cache,