summaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2009-10-25 11:25:50 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-12-01 18:20:07 +0000
commitb7dc0b2cfc6e9bc7270915c642a8a8e999b6095e (patch)
tree68853dc2d48f9abcd5eadab0dc181ad8b0e8ac59 /arch/arm/mm
parent2f0b192633f1fbf253b21c90938733491549edae (diff)
downloadop-kernel-dev-b7dc0b2cfc6e9bc7270915c642a8a8e999b6095e.zip
op-kernel-dev-b7dc0b2cfc6e9bc7270915c642a8a8e999b6095e.tar.gz
ARM: Avoid evaluating page_address() multiple times
page_address() is a function call rather than a macro, and so: if (page_address(page)) do_something(page_address(page)); results in two calls to this function. This is unnecessary; remove the duplication. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/flush.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index a480f16..43474d8 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -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,
OpenPOWER on IntegriCloud