diff mbox

[v2,3/4] hw/sh_serial: Use TARGET_PRIxPHYS rather than %x for physaddr

Message ID 1340639544-26520-4-git-send-email-peter.maydell@linaro.org
State New
Headers show

Commit Message

Peter Maydell June 25, 2012, 3:52 p.m. UTC
Switch a format string from %x to TARGET_PRIxPHYS so that it will
continue to work even if target_phys_addr_t is changed
to 64 bits in the future.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/sh_serial.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

Comments

Andreas Färber June 25, 2012, 4:44 p.m. UTC | #1
Am 25.06.2012 17:52, schrieb Peter Maydell:
> Switch a format string from %x to TARGET_PRIxPHYS so that it will
> continue to work even if target_phys_addr_t is changed
> to 64 bits in the future.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Andreas Färber <afaerber@suse.de>

/-F
diff mbox

Patch

diff --git a/hw/sh_serial.c b/hw/sh_serial.c
index 43b0eb1..1d1883d 100644
--- a/hw/sh_serial.c
+++ b/hw/sh_serial.c
@@ -186,7 +186,8 @@  static void sh_serial_write(void *opaque, target_phys_addr_t offs,
         }
     }
 
-    fprintf(stderr, "sh_serial: unsupported write to 0x%02x\n", offs);
+    fprintf(stderr, "sh_serial: unsupported write to 0x%02"
+            TARGET_PRIxPHYS "\n", offs);
     abort();
 }
 
@@ -287,7 +288,8 @@  static uint64_t sh_serial_read(void *opaque, target_phys_addr_t offs,
 #endif
 
     if (ret & ~((1 << 16) - 1)) {
-        fprintf(stderr, "sh_serial: unsupported read from 0x%02x\n", offs);
+        fprintf(stderr, "sh_serial: unsupported read from 0x%02"
+                TARGET_PRIxPHYS "\n", offs);
         abort();
     }