]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ARM] arm's arch_local_page_offset() fix against 2.6.17-rc1
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tue, 4 Apr 2006 15:06:00 +0000 (16:06 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 4 Apr 2006 15:06:00 +0000 (16:06 +0100)
This patch fixes arch_local_page_offset(pfn,nid) in arm.
This new one (added by unify_pfn_to_page patches) is obviously buggy.

This macro calculate page offset in a node.

Note: about LOCAL_MAP_NR()
comment in arm's sub-archs says...

 /*
  * Given a kaddr, LOCAL_MAP_NR finds the owning node of the memory
  * and returns the index corresponding to the appropriate page in the
  * node's mem_map.
  */

but LOCAL_MAP_NR() is designed to be able to take both paddr and kaddr.
In this case, paddr is better.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitu.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
include/asm-arm/memory.h

index 2b3cf69b3ed9eda46633c85beeb97eef81058da8..a814e73e6656b5843c5650eda8b2e7a5e2339dec 100644 (file)
@@ -188,7 +188,7 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
  */
 #include <linux/numa.h>
 #define arch_pfn_to_nid(pfn)   (PFN_TO_NID(pfn))
-#define arch_local_page_offset(pfn, nid) (LOCAL_MAP_NR((pfn) << PAGE_OFFSET))
+#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
 
 #define pfn_valid(pfn)                                         \
        ({                                                      \