PATCH: fix printf for mmio_dump for address 0

0 views
Skip to first unread message

Tim Hockin

unread,
Jan 31, 2009, 4:58:20 PM1/31/09
to iotool...@googlegroups.com
mmio_dump prints the address as a %p, which becomes (nil) for address 0.
Use a uint64_t instead.


Index: mmio_rw.c
===================================================================
--- mmio_rw.c (revision 22)
+++ mmio_rw.c (working copy)
@@ -214,7 +214,8 @@
int bytes_printed = sizeof(*addr);
/* Print out the current address. */
if (!fields_on_line) {
- fprintf(stdout, "%p:", (void *)(long)desired_addr);
+ fprintf(stdout, "0x%016llx:",
+ (unsigned long long)desired_addr);
}

/* Print out the leftover bytes. */

Aaron Durbin

unread,
Jan 31, 2009, 6:02:23 PM1/31/09
to iotool...@googlegroups.com
I thought I was the only one who knew about this. :) Thanks for fixing it.
Reply all
Reply to author
Forward
0 new messages