From 27dbc1d457a99ca3d7453f6c9330baee0943aafb Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 7 Dec 2020 08:39:05 +0900 Subject: [PATCH] common: splash_source: fix -Wint-to-pointer-cast warning 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); | ^ Change-Id: I3ab5875a7c33c0b22b2824dc8534dafcf70abd26 Signed-off-by: Jaehoon Chung --- common/splash_source.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/splash_source.c b/common/splash_source.c index f51ca5d..e50bdfe 100644 --- a/common/splash_source.c +++ b/common/splash_source.c @@ -36,7 +36,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) @@ -97,7 +97,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) -- 2.7.4