All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC PATCH v2 19/20] Use uintptr_t for 32/64-bit compatibility
Date: Fri, 23 Sep 2011 09:22:21 -0700	[thread overview]
Message-ID: <1316794942-24709-20-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1316794942-24709-1-git-send-email-sjg@chromium.org>

This fixes a few problems when building on 64-bit machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 common/cmd_mem.c     |    2 +-
 common/fdt_support.c |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index d6965e2..badec21 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -937,7 +937,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 			if (readback != val) {
 				printf ("\nMem error @ 0x%08X: "
 					"found %08lX, expected %08lX\n",
-					(uint)addr, readback, val);
+					(uint)(uintptr_t)addr, readback, val);
 				errs++;
 				if (ctrlc()) {
 					putc ('\n');
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 19b2ef6..9bed3ce 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -495,7 +495,7 @@ int fdt_resize(void *blob)
 	total = fdt_num_mem_rsv(blob);
 	for (i = 0; i < total; i++) {
 		fdt_get_mem_rsv(blob, i, &addr, &size);
-		if (addr == (uint64_t)(u32)blob) {
+		if (addr == (uintptr_t)blob) {
 			fdt_del_mem_rsv(blob, i);
 			break;
 		}
@@ -511,14 +511,14 @@ int fdt_resize(void *blob)
 		fdt_size_dt_strings(blob) + 5 * sizeof(struct fdt_reserve_entry);
 
 	/* Make it so the fdt ends on a page boundary */
-	actualsize = ALIGN(actualsize + ((uint)blob & 0xfff), 0x1000);
-	actualsize = actualsize - ((uint)blob & 0xfff);
+	actualsize = ALIGN(actualsize + ((uintptr_t)blob & 0xfff), 0x1000);
+	actualsize = actualsize - ((uintptr_t)blob & 0xfff);
 
 	/* Change the fdt header to reflect the correct size */
 	fdt_set_totalsize(blob, actualsize);
 
 	/* Add the new reservation */
-	ret = fdt_add_mem_rsv(blob, (uint)blob, actualsize);
+	ret = fdt_add_mem_rsv(blob, (uintptr_t)blob, actualsize);
 	if (ret < 0)
 		return ret;
 
-- 
1.7.3.1

  parent reply	other threads:[~2011-09-23 16:22 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 16:22 [U-Boot] [RFC PATCH v2 0/20] New 'sandbox' test architecture for U-Boot Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 01/20] sandbox: Add architecture header files Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 02/20] Fix use of int as pointer in image.c Simon Glass
2011-09-26  5:00   ` Mike Frysinger
2011-09-26 16:51     ` Simon Glass
2011-10-03  5:14       ` Mike Frysinger
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 03/20] sandbox: Add architecture image support Simon Glass
2011-09-26  5:01   ` Mike Frysinger
2011-09-26 19:39     ` Simon Glass
2011-09-26 20:19       ` Mike Frysinger
2011-09-26 20:24         ` Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 04/20] sandbox: Add compiler defines to support a 64-bit x86_64 platform Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 05/20] sandbox: Add cpu files Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 06/20] sandbox: Add architecture lib files Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 07/20] sandbox: Add sandbox board Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 08/20] sandbox: Add board info for architecture Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 09/20] sandbox: Add bootm support Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 10/20] sandbox: Disable built-in malloc Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 11/20] sandbox: Disable standalone/API support Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 12/20] sandbox: Force command sections to be 4-byte aligned Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 13/20] sandbox: Add OS dependent layer Simon Glass
2011-09-26  5:16   ` Mike Frysinger
2011-09-26 21:04     ` Simon Glass
2011-09-26 21:19       ` Mike Frysinger
2011-09-26 22:03         ` Simon Glass
2011-09-26 23:53           ` Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 14/20] sandbox: Add board_init() Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 15/20] sandbox: Add main program Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 16/20] sandbox: Add serial uart Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 17/20] sandbox: Add basic config file Simon Glass
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 18/20] Remove unused variable warnings in cmd_mem, cmd_nvedit Simon Glass
2011-09-23 16:22 ` Simon Glass [this message]
2011-09-23 16:22 ` [U-Boot] [RFC PATCH v2 20/20] sandbox: Makefile changes to build sandbox architecture Simon Glass
2011-09-26  4:59 ` [U-Boot] [RFC PATCH v2 0/20] New 'sandbox' test architecture for U-Boot Mike Frysinger
2011-09-27  0:07   ` Simon Glass
2011-10-03  5:16     ` Mike Frysinger

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=1316794942-24709-20-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.