diff mbox

ppc405: use RAM_ADDR_FMT instead of %08lx

Message ID 1315227749-26187-1-git-send-email-stefanha@linux.vnet.ibm.com
State New
Headers show

Commit Message

Stefan Hajnoczi Sept. 5, 2011, 1:02 p.m. UTC
The RAM_ADDR_FMT macro hides the type of ram_addr_t so that format
strings can be safely used.  Make sure to use RAM_ADDR_FMT so that the
build works on 32-bit hosts with Xen enabled.  Whether Xen should affect
ppc TCG targets is questionable but a separate issue.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 hw/ppc405_boards.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

Comments

Alexander Graf Sept. 7, 2011, 11:34 a.m. UTC | #1
On 05.09.2011, at 15:02, Stefan Hajnoczi wrote:

> The RAM_ADDR_FMT macro hides the type of ram_addr_t so that format
> strings can be safely used.  Make sure to use RAM_ADDR_FMT so that the
> build works on 32-bit hosts with Xen enabled.  Whether Xen should affect
> ppc TCG targets is questionable but a separate issue.

Thanks, applied.

Alex
diff mbox

Patch

diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c
index dec165e4..5da26dc 100644
--- a/hw/ppc405_boards.c
+++ b/hw/ppc405_boards.c
@@ -211,7 +211,8 @@  static void ref405ep_init (ram_addr_t ram_size,
     sram_size = 512 * 1024;
     sram_offset = qemu_ram_alloc(NULL, "ef405ep.sram", sram_size);
 #ifdef DEBUG_BOARD_INIT
-    printf("%s: register SRAM at offset %08lx\n", __func__, sram_offset);
+    printf("%s: register SRAM at offset " RAM_ADDR_FMT "\n",
+           __func__, sram_offset);
 #endif
     cpu_register_physical_memory(0xFFF00000, sram_size,
                                  sram_offset | IO_MEM_RAM);
@@ -228,7 +229,7 @@  static void ref405ep_init (ram_addr_t ram_size,
         fl_sectors = (bios_size + 65535) >> 16;
 #ifdef DEBUG_BOARD_INIT
         printf("Register parallel flash %d size %lx"
-               " at offset %08lx addr %lx '%s' %d\n",
+               " at offset " RAM_ADDR_FMT " addr %lx '%s' %d\n",
                fl_idx, bios_size, bios_offset, -bios_size,
                bdrv_get_device_name(dinfo->bdrv), fl_sectors);
 #endif
@@ -353,7 +354,7 @@  static void ref405ep_init (ram_addr_t ram_size,
 #ifdef DEBUG_BOARD_INIT
     printf("%s: Done\n", __func__);
 #endif
-    printf("bdloc %016lx\n", (unsigned long)bdloc);
+    printf("bdloc " RAM_ADDR_FMT "\n", bdloc);
 }
 
 static QEMUMachine ref405ep_machine = {
@@ -547,7 +548,7 @@  static void taihu_405ep_init(ram_addr_t ram_size,
         bios_offset = qemu_ram_alloc(NULL, "taihu_405ep.bios", bios_size);
 #ifdef DEBUG_BOARD_INIT
         printf("Register parallel flash %d size %lx"
-               " at offset %08lx addr %lx '%s' %d\n",
+               " at offset " RAM_ADDR_FMT " addr %lx '%s' %d\n",
                fl_idx, bios_size, bios_offset, -bios_size,
                bdrv_get_device_name(dinfo->bdrv), fl_sectors);
 #endif
@@ -590,7 +591,7 @@  static void taihu_405ep_init(ram_addr_t ram_size,
         fl_sectors = (bios_size + 65535) >> 16;
 #ifdef DEBUG_BOARD_INIT
         printf("Register parallel flash %d size %lx"
-               " at offset %08lx  addr " TARGET_FMT_lx " '%s'\n",
+               " at offset " RAM_ADDR_FMT "  addr " TARGET_FMT_lx " '%s'\n",
                fl_idx, bios_size, bios_offset, (target_ulong)0xfc000000,
                bdrv_get_device_name(dinfo->bdrv));
 #endif