[PATCH] arm's arch_local_page_offset() fix against 2.6.17-rc1

From: KAMEZAWA Hiroyuki
Date: Mon Apr 03 2006 - 05:18:10 EST


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@xxxxxxxxxxxxx>

Index: linux-2.6.17-rc1/include/asm-arm/memory.h
===================================================================
--- linux-2.6.17-rc1.orig/include/asm-arm/memory.h
+++ linux-2.6.17-rc1/include/asm-arm/memory.h
@@ -188,7 +188,7 @@ static inline __deprecated void *bus_to_
*/
#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) \
({ \

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/