]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common: splash_source: fix -Wint-to-pointer-cast warning
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 7 Dec 2020 08:18:51 +0000 (17:18 +0900)
committerAnatolij Gustschin <agust@denx.de>
Fri, 19 Feb 2021 21:17:10 +0000 (22:17 +0100)
Fix -Wint-to-pointer-cast warning

common/splash_source.c: In function 'splash_load_raw':
common/splash_source.c:100:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  100 |  bmp_hdr = (struct bmp_header *)bmp_load_addr;
      |            ^
common/splash_source.c: In function 'splash_sf_read_raw':
common/splash_source.c:39:47: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   39 |  return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr);
      |                                               ^

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/splash_source.c

index d7f179e3ea496ebacef74db94c5bf2f50a0bcfb4..3cf926d91a00beafb06f15a13fcbd867128cab37 100644 (file)
@@ -37,7 +37,7 @@ static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
                        return -ENODEV;
        }
 
-       return spi_flash_read(sf, offset, read_size, (void *)bmp_load_addr);
+       return spi_flash_read(sf, offset, read_size, (void *)(uintptr_t)bmp_load_addr);
 }
 #else
 static int splash_sf_read_raw(u32 bmp_load_addr, int offset, size_t read_size)
@@ -98,7 +98,7 @@ static int splash_load_raw(struct splash_location *location, u32 bmp_load_addr)
        if (res < 0)
                return res;
 
-       bmp_hdr = (struct bmp_header *)bmp_load_addr;
+       bmp_hdr = (struct bmp_header *)(uintptr_t)bmp_load_addr;
        bmp_size = le32_to_cpu(bmp_hdr->file_size);
 
        if (bmp_load_addr + bmp_size >= gd->start_addr_sp)