[dtc][PATCH] Fix ftdump data walking

From: Jimi Xenidis <hidden>
Date: 2006-05-15 15:48:02
Subsystem: the rest · Maintainer: Linus Torvalds

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

Signed-off-by: Jimi Xenidis <redacted>
---
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 {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help