devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Devicetree Compiler
	<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: David Gibson
	<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>,
	Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>,
	Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: [PATCH 2/3] Tweak code to display cell values
Date: Wed, 18 Jun 2014 01:00:23 -0600	[thread overview]
Message-ID: <1403074825-5069-2-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1403074825-5069-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>

Move the division out of the loop; this seems slightly cleaner.

Signed-off-by: Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
---
 util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/util.c b/util.c
index 1ce8b97..9d65226 100644
--- a/util.c
+++ b/util.c
@@ -371,9 +371,9 @@ void utilfdt_print_data(const char *data, int len)
 		const uint32_t *cell = (const uint32_t *)data;
 
 		printf(" = <");
-		for (i = 0; i < len; i += 4)
-			printf("0x%08x%s", fdt32_to_cpu(cell[i / 4]),
-			       i < (len - 4) ? " " : "");
+		for (i = 0, len /= 4; i < len; i++)
+			printf("0x%08x%s", fdt32_to_cpu(cell[i]),
+			       i < (len - 1) ? " " : "");
 		printf(">");
 	} else {
 		printf(" = [");
-- 
2.0.0.526.g5318336

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-06-18  7:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18  7:00 [PATCH 1/3] Correct output from memreserve in fdtdump Simon Glass
     [not found] ` <1403074825-5069-1-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2014-06-18  7:00   ` Simon Glass [this message]
     [not found]     ` <1403074825-5069-2-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2014-06-18 11:15       ` [PATCH 2/3] Tweak code to display cell values David Gibson
2014-06-18  7:00   ` [PATCH 3/3] Add a basic test for fdtdump Simon Glass
     [not found]     ` <1403074825-5069-3-git-send-email-sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2014-06-18 11:26       ` David Gibson
2014-06-18 10:32   ` [PATCH 1/3] Correct output from memreserve in fdtdump David Gibson
     [not found]     ` <20140618103215.GF29264-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2014-06-18 11:14       ` David Gibson
     [not found]         ` <20140618111429.GG29264-1s0os16eZneny3qCrzbmXA@public.gmane.org>
2014-06-18 14:24           ` Jon Loeliger
     [not found]             ` <E1WxGmt-0004MW-Vk-CYoMK+44s/E@public.gmane.org>
2014-06-23 12:21               ` Simon Glass

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=1403074825-5069-2-git-send-email-sjg@chromium.org \
    --to=sjg-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
    --cc=david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=jdl-CYoMK+44s/E@public.gmane.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;
as well as URLs for NNTP newsgroup(s).