Skip to contentSkip to conversation

ioapic: fix build with DEBUG_IOAPIC

PATCH Superseded Jason Wang 2 participants 2 messages Mar 8, 2012 – Mar 15, 2012

lore
Share & tools
lore

Jason Wang

author
#0 lore raw

PATCH 1/1 ioapic: fix build with DEBUG_IOAPIC

ioapic.c:198: error: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’

---
 hw/ioapic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/ioapic.c +1 -1
index 3fee011..2b0e6e9 100644
@@ -195,7 +195,7 @@ ioapic_mem_write(void *opaque, target_phys_addr_t addr, uint64_t val,
         if (size != 4) {
             break;
         }
-        DPRINTF("write: %08x = %08x\n", s->ioregsel, val);
+        DPRINTF("write: %08x = %lx\n", s->ioregsel, val);
         switch (s->ioregsel) {
         case IOAPIC_REG_ID:
             s->id = (val >> IOAPIC_ID_SHIFT) & IOAPIC_ID_MASK;
#1 lore raw
Quoted 12 lines · Jason Wang

ioapic.c:198: error: format ‘%08x’ expects type ‘unsigned int’, but argument 3 has type ‘uint64_t’

---
 hw/ioapic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/ioapic.c +0 -0
index 3fee011..2b0e6e9 100644

hw/ioapic.c ioapic_mem_write(void *opaque, target_phys_addr_t addr, uint64_t val, · line 198

Quoted 5 lines
hw/ioapic.c +1 -1
@@ -195,7 +195,7 @@ ioapic_mem_write(void *opaque, target_phys_addr_t addr, uint64_t val,
         if (size != 4) {
             break;
         }
-        DPRINTF("write: %08x = %08x\n", s->ioregsel, val);
+        DPRINTF("write: %08x = %lx\n", s->ioregsel, val);

Please use PRIx64 since the argument is uint64_t. On a 32-bit host the %lx format string will be wrong and the compiler may issue a warning.

Stefan