On 01/19/2018 09:56 AM, Marc-Andre Lureau wrote:
On Fri, Jan 19, 2018 at 3:36 PM, <no-re...@patchew.org> wrote:
/tmp/qemu-test/src/hw/tpm/tpm_crb.c: In function 'tpm_crb_mmio_read':
/tmp/qemu-test/src/hw/tpm/tpm_crb.c:126:13: error: format '%lx' expects
argument of type 'long unsigned int', but argument 2 has type 'hwaddr {aka long
long unsigned int}' [-Werror=format=]
DPRINTF("CRB read 0x%lx:%s len:%u\n",
^
/tmp/qemu-test/src/hw/tpm/tpm_crb.c:48:20: note: in definition of macro
'DPRINTF'
printf(fmt, ## __VA_ARGS__); \
^~~
/tmp/qemu-test/src/hw/tpm/tpm_crb.c: In function 'tpm_crb_mmio_write':
/tmp/qemu-test/src/hw/tpm/tpm_crb.c:146:13: error: format '%lx' expects
argument of type 'long unsigned int', but argument 2 has type 'hwaddr {aka long
long unsigned int}' [-Werror=format=]
DPRINTF("CRB write 0x%lx:%s len:%u val:%lu\n",
^
/tmp/qemu-test/src/hw/tpm/tpm_crb.c:48:20: note: in definition of macro
'DPRINTF'
printf(fmt, ## __VA_ARGS__); \
^~~
/tmp/qemu-test/src/hw/tpm/tpm_crb.c:146:13: error: format '%lu' expects
argument of type 'long unsigned int', but argument 5 has type 'uint64_t {aka
long long unsigned int}' [-Werror=format=]
DPRINTF("CRB write 0x%lx:%s len:%u val:%lu\n",
^
/tmp/qemu-test/src/hw/tpm/tpm_crb.c:48:20: note: in definition of macro
'DPRINTF'
printf(fmt, ## __VA_ARGS__); \
^~~
This will fix it:
Stefan feel free to squash it if no further changes required
Will do. Thanks.
--- a/hw/tpm/tpm_crb.c
+++ b/hw/tpm/tpm_crb.c
@@ -123,7 +123,7 @@ static uint64_t tpm_crb_mmio_read(void *opaque, hwaddr addr,
unsigned size)
{
CRBState *s = CRB(opaque);
- DPRINTF("CRB read 0x%lx:%s len:%u\n",
+ DPRINTF("CRB read 0x" TARGET_FMT_plx ":%s len:%u\n",
addr, addr_desc(addr), size);
void *regs = (void *)&s->regs + addr;
@@ -143,7 +143,7 @@ static void tpm_crb_mmio_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
CRBState *s = CRB(opaque);
- DPRINTF("CRB write 0x%lx:%s len:%u val:%lu\n",
+ DPRINTF("CRB write 0x" TARGET_FMT_plx ":%s len:%u val:%" PRIu64 "\n",
addr, addr_desc(addr), size, val);
switch (addr) {