qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] hw/a9mpcore: Fix compilation failure if physadd


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] hw/a9mpcore: Fix compilation failure if physaddrs are 64 bit
Date: Tue, 22 May 2012 11:09:02 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 05/22/2012 11:04 AM, Peter Maydell wrote:
> Add a cast to a logging printf to avoid a compilation failure
> if target_phys_addr_t is a 64 bit type. (This is better than
> using TARGET_FMT_plx because we really don't need a full
> 16 digit hex string to print the offset into a device.)
> 
> Signed-off-by: Peter Maydell <address@hidden>
> ---
>  hw/a9mpcore.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/a9mpcore.c b/hw/a9mpcore.c
> index c2ff74d..98f52f0 100644
> --- a/hw/a9mpcore.c
> +++ b/hw/a9mpcore.c
> @@ -75,7 +75,7 @@ static void a9_scu_write(void *opaque, target_phys_addr_t 
> offset,
>          break;
>      default:
>          fprintf(stderr, "Invalid size %u in write to a9 scu register %x\n",
> -                size, offset);
> +                size, (uint32_t)offset);

NACK.  %x and (uint32_t) are not necessarily compatible types (some
platforms implement uint32_t as long).  If you use %x, then cast to
(unsigned int) instead.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]