From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Fri, 23 Sep 2011 09:22:21 -0700 Subject: [U-Boot] [RFC PATCH v2 19/20] Use uintptr_t for 32/64-bit compatibility In-Reply-To: <1316794942-24709-1-git-send-email-sjg@chromium.org> References: <1316794942-24709-1-git-send-email-sjg@chromium.org> Message-ID: <1316794942-24709-20-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This fixes a few problems when building on 64-bit machines. Signed-off-by: Simon Glass --- 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