From: Dave Hansen discontig.c has its own version of set_max_mapnr_init(). However, all that it really does differently from the mm/init.c version is skip setting max_mapnr (which doesn't exist because there's no mem_map[]). Signed-off-by: Dave Hansen Signed-off-by: Andrew Morton --- 25-akpm/arch/i386/mm/discontig.c | 9 --------- 25-akpm/arch/i386/mm/init.c | 11 +++++++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff -puN arch/i386/mm/discontig.c~consolidate-set_max_mapnr_init-implementations arch/i386/mm/discontig.c --- 25/arch/i386/mm/discontig.c~consolidate-set_max_mapnr_init-implementations Fri Feb 4 15:01:42 2005 +++ 25-akpm/arch/i386/mm/discontig.c Fri Feb 4 15:01:42 2005 @@ -364,12 +364,3 @@ void __init set_highmem_pages_init(int b totalram_pages += totalhigh_pages; #endif } - -void __init set_max_mapnr_init(void) -{ -#ifdef CONFIG_HIGHMEM - num_physpages = highend_pfn; -#else - num_physpages = max_low_pfn; -#endif -} diff -puN arch/i386/mm/init.c~consolidate-set_max_mapnr_init-implementations arch/i386/mm/init.c --- 25/arch/i386/mm/init.c~consolidate-set_max_mapnr_init-implementations Fri Feb 4 15:01:42 2005 +++ 25-akpm/arch/i386/mm/init.c Fri Feb 4 15:01:42 2005 @@ -548,19 +548,22 @@ void __init test_wp_bit(void) } } -#ifndef CONFIG_DISCONTIGMEM static void __init set_max_mapnr_init(void) { #ifdef CONFIG_HIGHMEM - max_mapnr = num_physpages = highend_pfn; + num_physpages = highend_pfn; #else - max_mapnr = num_physpages = max_low_pfn; + num_physpages = max_low_pfn; +#endif +#ifndef CONFIG_DISCONTIGMEM + max_mapnr = num_physpages; #endif } + +#ifndef CONFIG_DISCONTIGMEM #define __free_all_bootmem() free_all_bootmem() #else #define __free_all_bootmem() free_all_bootmem_node(NODE_DATA(0)) -extern void set_max_mapnr_init(void); #endif /* !CONFIG_DISCONTIGMEM */ static struct kcore_list kcore_mem, kcore_vmalloc; _