Received: from eggs.gnu.org ([2001:4830:134:3::10]:38835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uw73Q-0005Oe-BV for qemu-devel@nongnu.org; Mon, 08 Jul 2013 04:44:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uw73O-0004UH-2R for qemu-devel@nongnu.org; Mon, 08 Jul 2013 04:44:16 -0400 Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:1d0::1]:58460 helo=mnementh.archaic.org.uk) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uw73N-0004PM-Sc for qemu-devel@nongnu.org; Mon, 08 Jul 2013 04:44:14 -0400 From: Peter Maydell Date: Mon, 8 Jul 2013 09:44:04 +0100 Message-Id: <1373273044-18736-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] exec.c: Pass correct pointer type to qemu_ram_ptr_length List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , patches@linaro.org Commit e3127ae0 introduced a problem where we're passing a hwaddr* to qemu_ram_ptr_length() but it wants a ram_addr_t*; this will cause problems on 32 bit hosts and in any case provokes a clang warning on MacOSX: CC arm-softmmu/exec.o exec.c:2164:46: warning: incompatible pointer types passing 'hwaddr *' (aka 'unsigned long long *') to parameter of type 'ram_addr_t *' (aka 'unsigned long *') [-Wincompatible-pointer-types] return qemu_ram_ptr_length(raddr + base, plen); ^~~~ exec.c:1392:63: note: passing argument to parameter 'size' here static void *qemu_ram_ptr_length(ram_addr_t addr, ram_addr_t *size) ^ Since this function is only used in one place, change its prototype to pass a hwaddr* rather than a ram_addr_t*, rather than contorting the calling code to get the type right. Signed-off-by: Peter Maydell --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 03fdf7e..50d29de 100644 --- a/exec.c +++ b/exec.c @@ -1389,7 +1389,7 @@ static void *qemu_safe_ram_ptr(ram_addr_t addr) /* Return a host pointer to guest's ram. Similar to qemu_get_ram_ptr * but takes a size argument */ -static void *qemu_ram_ptr_length(ram_addr_t addr, ram_addr_t *size) +static void *qemu_ram_ptr_length(ram_addr_t addr, hwaddr *size) { if (*size == 0) { return NULL; -- 1.7.11.4