Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758275Ab1CaPX5 (ORCPT ); Thu, 31 Mar 2011 11:23:57 -0400 Received: from relay2.sgi.com ([192.48.179.30]:42305 "HELO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1752817Ab1CaPXz (ORCPT ); Thu, 31 Mar 2011 11:23:55 -0400 Message-ID: <4D949C87.1000001@sgi.com> Date: Thu, 31 Mar 2011 08:23:51 -0700 From: Mike Travis User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Yinghai Lu Cc: Ingo Molnar , David Rientjes , Jack Steiner , Robin Holt , Len Brown , Thomas Gleixner , "H. Peter Anvin" , Andrew Morton , linux-acpi@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Tejun Heo , Linus Torvalds Subject: Re: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set References: <20110225180633.857892225@gulag1.americas.sgi.com> <20110225180634.017570095@gulag1.americas.sgi.com> <20110227120949.GF16453@elte.hu> <20110227121518.GA19165@elte.hu> <4D6AFBB0.70401@kernel.org> <4D6BF63D.2020404@sgi.com> <4D6BFF46.3050001@sgi.com> <4D93CDD7.8000708@sgi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1875 Lines: 64 Yinghai Lu wrote: > On Wed, Mar 30, 2011 at 5:41 PM, Mike Travis wrote: >> Subject: memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set >> Author: Yinghai Lu >> >> Add an error return if CONFIG_HAVE_MEMBLOCK is not set instead >> of having to add #ifdef CONFIG_HAVE_MEMBLOCK around blocks of >> code calling that function. >> >> Signed-off-by: Mike Travis >> --- >> include/linux/memblock.h | 9 ++++++++- >> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> --- linux.orig/include/linux/memblock.h >> +++ linux/include/linux/memblock.h >> @@ -2,6 +2,8 @@ >> #define _LINUX_MEMBLOCK_H >> #ifdef __KERNEL__ >> >> +#define MEMBLOCK_ERROR 0 >> + >> #ifdef CONFIG_HAVE_MEMBLOCK >> /* >> * Logical memory blocks. >> @@ -20,7 +22,6 @@ >> #include >> >> #define INIT_MEMBLOCK_REGIONS 128 >> -#define MEMBLOCK_ERROR 0 >> >> struct memblock_region { >> phys_addr_t base; >> @@ -160,6 +161,12 @@ static inline unsigned long memblock_reg >> #define __initdata_memblock >> #endif >> >> +#else >> +static inline phys_addr_t memblock_alloc(phys_addr_t size, phys_addr_t >> align) >> +{ >> + return MEMBLOCK_ERROR; >> +} >> + >> #endif /* CONFIG_HAVE_MEMBLOCK */ >> >> #endif /* __KERNEL__ */ >> > > setup_log_buf will pass function pointer, So this one is not needed, right? The other function would need the #ifdef CONFIG_HAVE_MEMBLOCK before calling memblock_alloc which I thought was the point of this patch? Note we still have the last fallback of using alloc_boot_mem in kernel/init.c. Thanks, Mike -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/