From: "Martin J. Bligh" <mbligh@aracnet.com>

Based on work from Bill Irwin <wli@holomorphy.com>

physnode_map[] needs to be signed so that pfn_to_nid() can return negative
values used to detect invalid pfn's.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/i386/kernel/numaq.c  |    2 +-
 25-akpm/arch/i386/kernel/srat.c   |    2 +-
 25-akpm/arch/i386/mm/discontig.c  |    2 +-
 25-akpm/include/asm-i386/mmzone.h |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff -puN arch/i386/kernel/numaq.c~physnode-map-can-go-negative arch/i386/kernel/numaq.c
--- 25/arch/i386/kernel/numaq.c~physnode-map-can-go-negative	2004-06-30 13:07:56.066479352 -0700
+++ 25-akpm/arch/i386/kernel/numaq.c	2004-06-30 13:07:56.074478136 -0700
@@ -92,7 +92,7 @@ static void __init initialize_physnode_m
 			cur = eq->hi_shrd_mem_start;
 			topofmem = eq->hi_shrd_mem_start + eq->hi_shrd_mem_size;
 			while (cur < topofmem) {
-				physnode_map[cur >> 8] = nid;
+				physnode_map[cur >> 8] = (s8) nid;
 				cur ++;
 			}
 		}
diff -puN arch/i386/kernel/srat.c~physnode-map-can-go-negative arch/i386/kernel/srat.c
--- 25/arch/i386/kernel/srat.c~physnode-map-can-go-negative	2004-06-30 13:07:56.067479200 -0700
+++ 25-akpm/arch/i386/kernel/srat.c	2004-06-30 13:07:56.075477984 -0700
@@ -193,7 +193,7 @@ static void __init initialize_physnode_m
 		for (pfn = nmcp->start_pfn; pfn <= nmcp->end_pfn;
 						pfn += PAGES_PER_ELEMENT)
 		{
-			physnode_map[pfn / PAGES_PER_ELEMENT] = (int)nmcp->nid;
+			physnode_map[pfn / PAGES_PER_ELEMENT] = (s8) nmcp->nid;
 		}
 	}
 }
diff -puN arch/i386/mm/discontig.c~physnode-map-can-go-negative arch/i386/mm/discontig.c
--- 25/arch/i386/mm/discontig.c~physnode-map-can-go-negative	2004-06-30 13:07:56.069478896 -0700
+++ 25-akpm/arch/i386/mm/discontig.c	2004-06-30 13:07:56.075477984 -0700
@@ -56,7 +56,7 @@ bootmem_data_t node0_bdata;
  *     physnode_map[4-7] = 1;
  *     physnode_map[8- ] = -1;
  */
-u8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
+s8 physnode_map[MAX_ELEMENTS] = { [0 ... (MAX_ELEMENTS - 1)] = -1};
 
 unsigned long node_start_pfn[MAX_NUMNODES];
 unsigned long node_end_pfn[MAX_NUMNODES];
diff -puN include/asm-i386/mmzone.h~physnode-map-can-go-negative include/asm-i386/mmzone.h
--- 25/include/asm-i386/mmzone.h~physnode-map-can-go-negative	2004-06-30 13:07:56.070478744 -0700
+++ 25-akpm/include/asm-i386/mmzone.h	2004-06-30 13:07:56.076477832 -0700
@@ -37,12 +37,12 @@ extern struct pglist_data *node_data[];
 #define MAX_ELEMENTS 256
 #define PAGES_PER_ELEMENT (MAX_NR_PAGES/MAX_ELEMENTS)
 
-extern u8 physnode_map[];
+extern s8 physnode_map[];
 
 static inline int pfn_to_nid(unsigned long pfn)
 {
 #ifdef CONFIG_NUMA
-	return(physnode_map[(pfn) / PAGES_PER_ELEMENT]);
+	return((int) physnode_map[(pfn) / PAGES_PER_ELEMENT]);
 #else
 	return 0;
 #endif
_