diff options
| author | Martin J. Bligh <mbligh@aracnet.com> | 2004-07-02 20:02:16 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-02 20:02:16 -0700 |
| commit | 3fec7922689a0a58eefd9d984ef6bcd0174804e7 (patch) | |
| tree | 402f976e7b51206496f47d49efe99e65fe8ba320 | |
| parent | 3796df42975a5010c5f9ec4a5968c7ee835e760a (diff) | |
[PATCH] ia32 NUMA: physnode_map entries can be negative
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>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | arch/i386/kernel/numaq.c | 2 | ||||
| -rw-r--r-- | arch/i386/kernel/srat.c | 2 | ||||
| -rw-r--r-- | arch/i386/mm/discontig.c | 2 | ||||
| -rw-r--r-- | include/asm-i386/mmzone.h | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/arch/i386/kernel/numaq.c b/arch/i386/kernel/numaq.c index a3e650b71f09..8ea0929cc75a 100644 --- a/arch/i386/kernel/numaq.c +++ b/arch/i386/kernel/numaq.c @@ -92,7 +92,7 @@ static void __init initialize_physnode_map(void) 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 --git a/arch/i386/kernel/srat.c b/arch/i386/kernel/srat.c index 8c0bd561f4d6..00c428734225 100644 --- a/arch/i386/kernel/srat.c +++ b/arch/i386/kernel/srat.c @@ -193,7 +193,7 @@ static void __init initialize_physnode_map(void) 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 --git a/arch/i386/mm/discontig.c b/arch/i386/mm/discontig.c index 99ff78c1093b..3948d4be00ee 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/i386/mm/discontig.c @@ -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 --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 3b8e4b7cc7cc..ed348f37eefc 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h @@ -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 |
