]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fdtdec: Cast prior_stage_fdt_address with uintptr_t
authorBin Meng <bin.meng@windriver.com>
Sun, 31 Jan 2021 12:36:03 +0000 (20:36 +0800)
committerSimon Glass <sjg@chromium.org>
Wed, 3 Feb 2021 10:38:41 +0000 (03:38 -0700)
At present prior_stage_fdt_address is declared as phys_addr_t. On
a 32-bit platform where phys_addr_t can be 64-bit, assigning its
value to gd->fdt_blob which is a pointer, can cause warnings.

Cast it to uintptr_t before the assignment.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
lib/fdtdec.c

index a2d2fb4e1fe6e5c6e65a353a8b37acd7528b2c96..e048f7777d62877a101a8a2ed34ead0e41ff0898 100644 (file)
@@ -1572,7 +1572,7 @@ int fdtdec_setup(void)
                return -1;
        }
 # elif defined(CONFIG_OF_PRIOR_STAGE)
-       gd->fdt_blob = (void *)prior_stage_fdt_address;
+       gd->fdt_blob = (void *)(uintptr_t)prior_stage_fdt_address;
 # endif
 # ifndef CONFIG_SPL_BUILD
        /* Allow the early environment to override the fdt address */