diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-03-05 15:04:57 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-08 14:34:17 -0400 |
commit | e954ef20c29b7af07a8cb5452f14fb69e3d9d2b2 (patch) | |
tree | 184ddda4789b9a8ba15b6bb28714bc32393ad4a1 /arch/x86/mm/init_32.c | |
parent | 5dd61dfabcaa5bfb67afb8a2d255bd1e156562e3 (diff) |
x86: fix warning about nodeid
Impact: cleanup
Ingo found there warning about nodeid with some configs.
try to use for_each_online_node for non numa too. in that case
nodeid will be 0.
also move out boundary checking from setup_node_bootmem(), so
non-numa config will not check it.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <49B03069.80001@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r-- | arch/x86/mm/init_32.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 2966c6b8d304..db81e9a8556b 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -806,11 +806,6 @@ static unsigned long __init setup_node_bootmem(int nodeid, | |||
806 | { | 806 | { |
807 | unsigned long bootmap_size; | 807 | unsigned long bootmap_size; |
808 | 808 | ||
809 | if (start_pfn > max_low_pfn) | ||
810 | return bootmap; | ||
811 | if (end_pfn > max_low_pfn) | ||
812 | end_pfn = max_low_pfn; | ||
813 | |||
814 | /* don't touch min_low_pfn */ | 809 | /* don't touch min_low_pfn */ |
815 | bootmap_size = init_bootmem_node(NODE_DATA(nodeid), | 810 | bootmap_size = init_bootmem_node(NODE_DATA(nodeid), |
816 | bootmap >> PAGE_SHIFT, | 811 | bootmap >> PAGE_SHIFT, |
@@ -843,13 +838,23 @@ void __init setup_bootmem_allocator(void) | |||
843 | max_pfn_mapped<<PAGE_SHIFT); | 838 | max_pfn_mapped<<PAGE_SHIFT); |
844 | printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT); | 839 | printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT); |
845 | 840 | ||
841 | for_each_online_node(nodeid) { | ||
842 | unsigned long start_pfn, end_pfn; | ||
843 | |||
846 | #ifdef CONFIG_NEED_MULTIPLE_NODES | 844 | #ifdef CONFIG_NEED_MULTIPLE_NODES |
847 | for_each_online_node(nodeid) | 845 | start_pfn = node_start_pfn[nodeid]; |
848 | bootmap = setup_node_bootmem(nodeid, node_start_pfn[nodeid], | 846 | end_pfn = node_end_pfn[nodeid]; |
849 | node_end_pfn[nodeid], bootmap); | 847 | if (start_pfn > max_low_pfn) |
848 | continue; | ||
849 | if (end_pfn > max_low_pfn) | ||
850 | end_pfn = max_low_pfn; | ||
850 | #else | 851 | #else |
851 | bootmap = setup_node_bootmem(0, 0, max_low_pfn, bootmap); | 852 | start_pfn = 0; |
853 | end_pfn = max_low_pfn; | ||
852 | #endif | 854 | #endif |
855 | bootmap = setup_node_bootmem(nodeid, start_pfn, end_pfn, | ||
856 | bootmap); | ||
857 | } | ||
853 | 858 | ||
854 | after_bootmem = 1; | 859 | after_bootmem = 1; |
855 | } | 860 | } |