summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorNikhil M Jain <n-jain1@ti.com>2023-06-21 17:20:51 +0530
committerUdit Kumar <u-kumar1@ti.com>2023-06-22 11:42:18 +0530
commit20bb8daa8a5a77b874a43a4faffc870e3c1bca45 (patch)
tree11f4d2622e8de04c49a5621f5e22bca719f34855 /common
parent9fe206aa746fc3e7a758edbef71e4932bac63c13 (diff)
common: splash_source: Fix type casting errors
During compilation splash_source puts out below warning for type conversion in splash_load_fit for bmp_load_addr and fit_header. Change their type to uintptr_t to fix the warnings. common/splash_source.c: In function ‘splash_load_fit’: common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 366 | img_header = (struct legacy_img_hdr *)bmp_load_addr; | ^ common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 376 | res = splash_storage_read_raw(location, (u32)fit_header, fit_size); | ^ common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 401 | memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size); The above warnings are generated if CONFIG_FIT is enabled. Signed-off-by: Nikhil M Jain <n-jain1@ti.com>
Diffstat (limited to 'common')
-rw-r--r--common/splash_source.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/splash_source.c b/common/splash_source.c
index 3c363b79f9..7fb28d7713 100644
--- a/common/splash_source.c
+++ b/common/splash_source.c
@@ -363,7 +363,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
if (res < 0)
return res;
- img_header = (struct legacy_img_hdr *)bmp_load_addr;
+ img_header = (struct legacy_img_hdr *)(uintptr_t)bmp_load_addr;
if (image_get_magic(img_header) != FDT_MAGIC) {
printf("Could not find FDT magic\n");
return -EINVAL;
@@ -373,7 +373,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
/* Read in entire FIT */
fit_header = (const u32 *)(bmp_load_addr + header_size);
- res = splash_storage_read_raw(location, (u32)fit_header, fit_size);
+ res = splash_storage_read_raw(location, (uintptr_t)fit_header, fit_size);
if (res < 0)
return res;
@@ -398,7 +398,7 @@ static int splash_load_fit(struct splash_location *location, u32 bmp_load_addr)
/* Extract the splash data from FIT */
/* 1. Test if splash is in FIT internal data. */
if (!fit_image_get_data(fit_header, node_offset, &internal_splash_data, &internal_splash_size))
- memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size);
+ memmove((void *)(uintptr_t)bmp_load_addr, internal_splash_data, internal_splash_size);
/* 2. Test if splash is in FIT external data with fixed position. */
else if (!fit_image_get_data_position(fit_header, node_offset, &external_splash_addr))
is_splash_external = true;