* [Qemu-devel] [PATCH] fix build errors when we enable acpi_piix4 debug
@ 2011-02-28 2:22 Wen Congyang
2011-04-01 20:08 ` Aurelien Jarno
0 siblings, 1 reply; 4+ messages in thread
From: Wen Congyang @ 2011-02-28 2:22 UTC (permalink / raw)
To: qemu-devel
I enable acpi_piix4 debug, and got the following build errors:
# make
CC libhw64/acpi_piix4.o
cc1: warnings being treated as errors
/home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_write’:
/home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
/home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’
/home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_read’:
/home/wency/source/qemu/hw/acpi_piix4.c:219: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
make[1]: *** [acpi_piix4.o] Error 1
make: *** [subdir-libhw64] Error 2
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
---
hw/acpi_piix4.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 5bbc2b5..b5a2762 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -190,7 +190,8 @@ static void pm_ioport_write(IORange *ioport, uint64_t addr, unsigned width,
default:
break;
}
- PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val);
+ PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", (unsigned int)addr,
+ (unsigned int)val);
}
static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
@@ -216,7 +217,7 @@ static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
val = 0;
break;
}
- PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val);
+ PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", (unsigned int)addr, val);
*data = val;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] fix build errors when we enable acpi_piix4 debug
2011-02-28 2:22 [Qemu-devel] [PATCH] fix build errors when we enable acpi_piix4 debug Wen Congyang
@ 2011-04-01 20:08 ` Aurelien Jarno
2011-04-01 23:41 ` Isaku Yamahata
0 siblings, 1 reply; 4+ messages in thread
From: Aurelien Jarno @ 2011-04-01 20:08 UTC (permalink / raw)
To: Wen Congyang; +Cc: qemu-devel
On Mon, Feb 28, 2011 at 10:22:33AM +0800, Wen Congyang wrote:
> I enable acpi_piix4 debug, and got the following build errors:
> # make
> CC libhw64/acpi_piix4.o
> cc1: warnings being treated as errors
> /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_write’:
> /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
> /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’
> /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_read’:
> /home/wency/source/qemu/hw/acpi_piix4.c:219: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
> make[1]: *** [acpi_piix4.o] Error 1
> make: *** [subdir-libhw64] Error 2
>
> Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
>
> ---
> hw/acpi_piix4.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
Thanks, applied.
> diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> index 5bbc2b5..b5a2762 100644
> --- a/hw/acpi_piix4.c
> +++ b/hw/acpi_piix4.c
> @@ -190,7 +190,8 @@ static void pm_ioport_write(IORange *ioport, uint64_t addr, unsigned width,
> default:
> break;
> }
> - PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val);
> + PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", (unsigned int)addr,
> + (unsigned int)val);
> }
>
> static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
> @@ -216,7 +217,7 @@ static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
> val = 0;
> break;
> }
> - PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val);
> + PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", (unsigned int)addr, val);
> *data = val;
> }
>
> --
> 1.7.1
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] fix build errors when we enable acpi_piix4 debug
2011-04-01 20:08 ` Aurelien Jarno
@ 2011-04-01 23:41 ` Isaku Yamahata
2011-04-03 14:58 ` Aurelien Jarno
0 siblings, 1 reply; 4+ messages in thread
From: Isaku Yamahata @ 2011-04-01 23:41 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: qemu-devel
Sorry for late comment after the commit.
PRIx64 shouldn't be used instead of cast?
On Fri, Apr 01, 2011 at 10:08:23PM +0200, Aurelien Jarno wrote:
> On Mon, Feb 28, 2011 at 10:22:33AM +0800, Wen Congyang wrote:
> > I enable acpi_piix4 debug, and got the following build errors:
> > # make
> > CC libhw64/acpi_piix4.o
> > cc1: warnings being treated as errors
> > /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_write’:
> > /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
> > /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’
> > /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_read’:
> > /home/wency/source/qemu/hw/acpi_piix4.c:219: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
> > make[1]: *** [acpi_piix4.o] Error 1
> > make: *** [subdir-libhw64] Error 2
> >
> > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> >
> > ---
> > hw/acpi_piix4.c | 5 +++--
> > 1 files changed, 3 insertions(+), 2 deletions(-)
>
> Thanks, applied.
>
> > diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> > index 5bbc2b5..b5a2762 100644
> > --- a/hw/acpi_piix4.c
> > +++ b/hw/acpi_piix4.c
> > @@ -190,7 +190,8 @@ static void pm_ioport_write(IORange *ioport, uint64_t addr, unsigned width,
> > default:
> > break;
> > }
> > - PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val);
> > + PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", (unsigned int)addr,
> > + (unsigned int)val);
> > }
> >
> > static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
> > @@ -216,7 +217,7 @@ static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
> > val = 0;
> > break;
> > }
> > - PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val);
> > + PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", (unsigned int)addr, val);
> > *data = val;
> > }
> >
> > --
> > 1.7.1
> >
> >
>
> --
> Aurelien Jarno GPG: 1024D/F1BCDB73
> aurelien@aurel32.net http://www.aurel32.net
>
--
yamahata
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] fix build errors when we enable acpi_piix4 debug
2011-04-01 23:41 ` Isaku Yamahata
@ 2011-04-03 14:58 ` Aurelien Jarno
0 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2011-04-03 14:58 UTC (permalink / raw)
To: Isaku Yamahata; +Cc: qemu-devel
On Sat, Apr 02, 2011 at 08:41:28AM +0900, Isaku Yamahata wrote:
> Sorry for late comment after the commit.
> PRIx64 shouldn't be used instead of cast?
It what I thought first, but given the port number is a small 16-bit
value, the cast is probably as good as the PRIx64. Also part of the
already existing code is using a cast.
That said if you feel the PRIx64 is better, don't hesitate to send a
patch to fix that.
> On Fri, Apr 01, 2011 at 10:08:23PM +0200, Aurelien Jarno wrote:
> > On Mon, Feb 28, 2011 at 10:22:33AM +0800, Wen Congyang wrote:
> > > I enable acpi_piix4 debug, and got the following build errors:
> > > # make
> > > CC libhw64/acpi_piix4.o
> > > cc1: warnings being treated as errors
> > > /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_write’:
> > > /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
> > > /home/wency/source/qemu/hw/acpi_piix4.c:193: error: format ‘%04x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’
> > > /home/wency/source/qemu/hw/acpi_piix4.c: In function ‘pm_ioport_read’:
> > > /home/wency/source/qemu/hw/acpi_piix4.c:219: error: format ‘%04x’ expects type ‘unsigned int’, but argument 2 has type ‘uint64_t’
> > > make[1]: *** [acpi_piix4.o] Error 1
> > > make: *** [subdir-libhw64] Error 2
> > >
> > > Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
> > >
> > > ---
> > > hw/acpi_piix4.c | 5 +++--
> > > 1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > Thanks, applied.
> >
> > > diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
> > > index 5bbc2b5..b5a2762 100644
> > > --- a/hw/acpi_piix4.c
> > > +++ b/hw/acpi_piix4.c
> > > @@ -190,7 +190,8 @@ static void pm_ioport_write(IORange *ioport, uint64_t addr, unsigned width,
> > > default:
> > > break;
> > > }
> > > - PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", addr, val);
> > > + PIIX4_DPRINTF("PM writew port=0x%04x val=0x%04x\n", (unsigned int)addr,
> > > + (unsigned int)val);
> > > }
> > >
> > > static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
> > > @@ -216,7 +217,7 @@ static void pm_ioport_read(IORange *ioport, uint64_t addr, unsigned width,
> > > val = 0;
> > > break;
> > > }
> > > - PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", addr, val);
> > > + PIIX4_DPRINTF("PM readw port=0x%04x val=0x%04x\n", (unsigned int)addr, val);
> > > *data = val;
> > > }
> > >
> > > --
> > > 1.7.1
> > >
> > >
> >
> > --
> > Aurelien Jarno GPG: 1024D/F1BCDB73
> > aurelien@aurel32.net http://www.aurel32.net
> >
>
> --
> yamahata
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-04-03 14:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-28 2:22 [Qemu-devel] [PATCH] fix build errors when we enable acpi_piix4 debug Wen Congyang
2011-04-01 20:08 ` Aurelien Jarno
2011-04-01 23:41 ` Isaku Yamahata
2011-04-03 14:58 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).