]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sandbox: Use uintptr_t for 32/64-bit compatibility
authorSimon Glass <sjg@chromium.org>
Sat, 17 Sep 2011 06:48:58 +0000 (06:48 +0000)
committerWolfgang Denk <wd@denx.de>
Mon, 17 Oct 2011 21:56:59 +0000 (23:56 +0200)
This fixes a problems when building on some 64-bit machines.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/cmd_mem.c
common/fdt_support.c

index e84cc4e22d3ee7ccbf0f95aab84d6c2e3cd56f7d..28476d750b0e6f76a87fa8c7a9eb0d823365e682 100644 (file)
@@ -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');
index abf6d5378101c2aef2406b427b19eb8b10ee7e23..e0d3fe33e7e1900b3eb49e16b88e27a5e60446fe 100644 (file)
@@ -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;