Commit e954ef20 authored by Yinghai Lu's avatar Yinghai Lu Committed by Ingo Molnar

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: default avatarYinghai Lu <yinghai@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <49B03069.80001@kernel.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5dd61dfa
...@@ -806,11 +806,6 @@ static unsigned long __init setup_node_bootmem(int nodeid, ...@@ -806,11 +806,6 @@ static unsigned long __init setup_node_bootmem(int nodeid,
{ {
unsigned long bootmap_size; unsigned long bootmap_size;
if (start_pfn > max_low_pfn)
return bootmap;
if (end_pfn > max_low_pfn)
end_pfn = max_low_pfn;
/* don't touch min_low_pfn */ /* don't touch min_low_pfn */
bootmap_size = init_bootmem_node(NODE_DATA(nodeid), bootmap_size = init_bootmem_node(NODE_DATA(nodeid),
bootmap >> PAGE_SHIFT, bootmap >> PAGE_SHIFT,
...@@ -843,13 +838,23 @@ void __init setup_bootmem_allocator(void) ...@@ -843,13 +838,23 @@ void __init setup_bootmem_allocator(void)
max_pfn_mapped<<PAGE_SHIFT); max_pfn_mapped<<PAGE_SHIFT);
printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT); printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn<<PAGE_SHIFT);
for_each_online_node(nodeid) {
unsigned long start_pfn, end_pfn;
#ifdef CONFIG_NEED_MULTIPLE_NODES #ifdef CONFIG_NEED_MULTIPLE_NODES
for_each_online_node(nodeid) start_pfn = node_start_pfn[nodeid];
bootmap = setup_node_bootmem(nodeid, node_start_pfn[nodeid], end_pfn = node_end_pfn[nodeid];
node_end_pfn[nodeid], bootmap); if (start_pfn > max_low_pfn)
continue;
if (end_pfn > max_low_pfn)
end_pfn = max_low_pfn;
#else #else
bootmap = setup_node_bootmem(0, 0, max_low_pfn, bootmap); start_pfn = 0;
end_pfn = max_low_pfn;
#endif #endif
bootmap = setup_node_bootmem(nodeid, start_pfn, end_pfn,
bootmap);
}
after_bootmem = 1; after_bootmem = 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment