From patchwork Thu Feb 10 16:53:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 82630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BD2BFB70EC for ; Fri, 11 Feb 2011 04:00:16 +1100 (EST) Received: from localhost ([127.0.0.1]:41628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnZsI-0004eU-SV for incoming@patchwork.ozlabs.org; Thu, 10 Feb 2011 12:00:10 -0500 Received: from [140.186.70.92] (port=59544 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PnZlV-0002El-28 for qemu-devel@nongnu.org; Thu, 10 Feb 2011 11:53:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PnZlT-0008CC-GH for qemu-devel@nongnu.org; Thu, 10 Feb 2011 11:53:08 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:22803) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PnZlT-0008Bp-5v for qemu-devel@nongnu.org; Thu, 10 Feb 2011 11:53:07 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PnZlQ-0003BZ-Jf; Thu, 10 Feb 2011 16:53:04 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 10 Feb 2011 16:53:04 +0000 Message-Id: <1297356784-12224-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: patches@linaro.org Subject: [Qemu-devel] [PATCH] linux-user: fix compile failure if !CONFIG_USE_GUEST_BASE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org If CONFIG_USE_GUEST_BASE is not defined, gcc complains: linux-user/mmap.c:235: error: comparison of unsigned expression >= 0 is always true because RESERVED_VA is #defined to 0. Since mmap_find_vma_reserved() will never be called anyway if RESERVED_VA is always 0, fix this by simply #ifdef'ing away the function and its callsite. Signed-off-by: Peter Maydell --- I'm not a great fan of introducing #ifdefs, but I couldn't come up with a cleaner way of shutting gcc up... linux-user/mmap.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index abf21f6..0cf22f8 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -216,6 +216,7 @@ static abi_ulong mmap_next_start = TASK_UNMAPPED_BASE; unsigned long last_brk; +#ifdef CONFIG_USE_GUEST_BASE /* Subroutine of mmap_find_vma, used when we have pre-allocated a chunk of guest address space. */ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size) @@ -249,6 +250,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size) mmap_next_start = addr; return last_addr; } +#endif /* * Find and reserve a free memory area of size 'size'. The search @@ -271,9 +273,11 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size) size = HOST_PAGE_ALIGN(size); +#ifdef CONFIG_USE_GUEST_BASE if (RESERVED_VA) { return mmap_find_vma_reserved(start, size); } +#endif addr = start; wrapped = repeat = 0;