Received: from eggs.gnu.org ([2001:4830:134:3::10]:33776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0GyJ-0002k9-5B for qemu-devel@nongnu.org; Fri, 19 Jul 2013 16:08:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0GyI-0007hn-3o for qemu-devel@nongnu.org; Fri, 19 Jul 2013 16:08:11 -0400 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:37616) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0GyH-0007hc-Uy for qemu-devel@nongnu.org; Fri, 19 Jul 2013 16:08:10 -0400 Received: by mail-ea0-f174.google.com with SMTP id o10so2596495eaj.33 for ; Fri, 19 Jul 2013 13:08:09 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 19 Jul 2013 22:07:55 +0200 Message-Id: <1374264478-23913-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1374264478-23913-1-git-send-email-pbonzini@redhat.com> References: <1374264478-23913-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1/4] 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: Peter Maydell From: Peter Maydell 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 Tested-by: Riku Voipio Tested-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index c99a883..d312bb4 100644 --- a/exec.c +++ b/exec.c @@ -1379,7 +1379,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.8.1.4