From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758734Ab1DYSLj (ORCPT ); Mon, 25 Apr 2011 14:11:39 -0400 Received: from relay2.sgi.com ([192.48.179.30]:34841 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757722Ab1DYSLi (ORCPT ); Mon, 25 Apr 2011 14:11:38 -0400 Message-Id: <20110425181136.211858618@gulag1.americas.sgi.com> References: <20110425181136.055235992@gulag1.americas.sgi.com> User-Agent: quilt/0.46-1 Date: Mon, 25 Apr 2011 13:11:37 -0500 From: Mike Travis To: Ingo Molnar , Yinghai Lu Cc: Andrew Morton , "H. Peter Anvin" , Jack Steiner , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] memblock: add error return when CONFIG_HAVE_MEMBLOCK is not set Content-Disposition: inline; filename=add-no-memblock Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Authored-by: Yinghai Lu 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__ */ --