[dtc][PATCH] Fix ftdump data walking

Jimi Xenidis jimix at watson.ibm.com
Tue May 16 01:47:43 EST 2006


This patch fixes a pointer addition bug in ftdump and handles endian  
issue.

Signed-off-by: Jimi Xenidis <jimix at watson.ibm.com>
---
diff --git a/ftdump.c b/ftdump.c
index 4d4354b..7e643c8 100644
--- a/ftdump.c
+++ b/ftdump.c
@@ -67,7 +67,8 @@ static void print_data(const void *data,
	} else if ((len % 4) == 0) {
		printf(" = <");
		for (i = 0; i < len; i += 4)
-			printf("%08x%s", *((uint32_t *)data + i),
+			printf("%08x%s",
+			       be32_to_cpu(*((uint32_t *)((ulong)data + i))),
			       i < (len - 4) ? " " : "");
		printf(">");
	} else {




More information about the Linuxppc-dev mailing list