From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjorn Helgaas Subject: Re: [PATCH 23/25] x86: Have nobootmem version setup_bootmem_allocator() Date: Tue, 29 Jun 2010 12:02:57 -0600 Message-ID: <201006291202.58730.bjorn.helgaas@hp.com> References: <1277227614-11581-1-git-send-email-yinghai@kernel.org> <1277227614-11581-24-git-send-email-yinghai@kernel.org> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Return-path: Received: from g1t0029.austin.hp.com ([15.216.28.36]:43438 "EHLO g1t0029.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754343Ab0F2SCQ (ORCPT ); Tue, 29 Jun 2010 14:02:16 -0400 In-Reply-To: <1277227614-11581-24-git-send-email-yinghai@kernel.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Yinghai Lu Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , David Miller , Benjamin Herrenschmidt , Linus Torvalds , Johannes Weiner , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org On Tuesday, June 22, 2010 11:26:52 am Yinghai Lu wrote: > We can reduce #ifdef number from 3 to one in init_32.c > > Signed-off-by: Yinghai Lu > --- > arch/x86/mm/init_32.c | 15 ++++++++++----- > 1 files changed, 10 insertions(+), 5 deletions(-) > > diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c > index e3ae067..f172aa3 100644 > --- a/arch/x86/mm/init_32.c > +++ b/arch/x86/mm/init_32.c > @@ -771,11 +771,9 @@ static unsigned long __init setup_node_bootmem(int nodeid, > > return bootmap + bootmap_size; > } > -#endif > > void __init setup_bootmem_allocator(void) > { > -#ifndef CONFIG_NO_BOOTMEM > int nodeid; > unsigned long bootmap_size, bootmap; > /* > @@ -787,13 +785,11 @@ void __init setup_bootmem_allocator(void) > if (bootmap == (unsigned long)LMB_ERROR) > panic("Cannot find bootmem map of size %ld\n", bootmap_size); > lmb_reserve_range(bootmap, bootmap + bootmap_size, "BOOTMAP"); > -#endif > > printk(KERN_INFO " mapped low ram: 0 - %08lx\n", > max_pfn_mapped< printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn< > -#ifndef CONFIG_NO_BOOTMEM > for_each_online_node(nodeid) { > unsigned long start_pfn, end_pfn; > > @@ -811,10 +807,19 @@ void __init setup_bootmem_allocator(void) > bootmap = setup_node_bootmem(nodeid, start_pfn, end_pfn, > bootmap); > } > -#endif > > after_bootmem = 1; > } > +#else > +void __init setup_bootmem_allocator(void) > +{ > + printk(KERN_INFO " mapped low ram: 0 - %08lx\n", > + max_pfn_mapped< + printk(KERN_INFO " low ram: 0 - %08lx\n", max_low_pfn< + > + after_bootmem = 1; > +} > +#endif > > /* > * paging_init() sets up the page tables - note that the first 8MB are >