]> git.baikalelectronics.ru Git - uboot.git/commitdiff
board: sifive: Fix -Wint-to-pointer-cast warning
authorBin Meng <bmeng.cn@gmail.com>
Sun, 12 Sep 2021 03:15:16 +0000 (11:15 +0800)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Wed, 20 Oct 2021 02:59:09 +0000 (10:59 +0800)
The following warning is seen in unleashed.c in a 32-bit build:

  warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Cast with uintptr_t.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
board/sifive/unleashed/unleashed.c
board/sifive/unmatched/unmatched.c

index 33baeda98665494060d3593f7fe985f92de1d238..e7d2332d8c957a4abbcfd0a26bb620a452444d92 100644 (file)
@@ -118,7 +118,7 @@ void *board_fdt_blob_setup(void)
 {
        if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
                if (gd->arch.firmware_fdt_addr)
-                       return (ulong *)gd->arch.firmware_fdt_addr;
+                       return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
        }
 
        return (ulong *)&_end;
index 8773b660faf08a422b53bbaff24beb6e87952af4..93c452c57fca35258b5c6700df7865ed8cac0ab1 100644 (file)
@@ -15,7 +15,7 @@ void *board_fdt_blob_setup(void)
 {
        if (IS_ENABLED(CONFIG_OF_SEPARATE)) {
                if (gd->arch.firmware_fdt_addr)
-                       return (ulong *)gd->arch.firmware_fdt_addr;
+                       return (ulong *)(uintptr_t)gd->arch.firmware_fdt_addr;
        }
 
        return (ulong *)&_end;