LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jimi Xenidis <jimix@watson.ibm.com>
To: linuxppc-dev@ozlabs.org
Subject: [dtc][PATCH] Fix ftdump data walking
Date: Mon, 15 May 2006 11:47:43 -0400	[thread overview]
Message-ID: <D46A754B-CDF8-4582-80BA-39B50ACD2D55@watson.ibm.com> (raw)

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

Signed-off-by: Jimi Xenidis <jimix@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 {

                 reply	other threads:[~2006-05-15 15:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D46A754B-CDF8-4582-80BA-39B50ACD2D55@watson.ibm.com \
    --to=jimix@watson.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox