From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Travis Subject: Re: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set Date: Thu, 07 Apr 2011 12:43:16 -0700 Message-ID: <4D9E13D4.3080702@sgi.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from relay1.sgi.com ([192.48.179.29]:42639 "HELO relay.sgi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1756565Ab1DGTnV (ORCPT ); Thu, 7 Apr 2011 15:43:21 -0400 In-Reply-To: <4D93CDD7.8000708@sgi.com> Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Yinghai Lu , Ingo Molnar Cc: 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 Was there any further objections to these patches? 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__ */ > >