summaryrefslogtreecommitdiff
path: root/boot/bootm.c
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2024-03-26 23:13:11 +0100
committerTom Rini <[email protected]>2024-04-11 09:38:57 -0600
commita4df06e41fa29ebc2b31b15ae229b2273af69fa6 (patch)
tree16252c9d012f367b0b660d4ad5224eff48a733f1 /boot/bootm.c
parentd545fe3b82ca319f699abb40f59f7ab5f8116de5 (diff)
boot: fdt: Change type of env_get_bootm_low() to phys_addr_t
Change type of ulong env_get_bootm_low() to phys_addr_t env_get_bootm_low(). The PPC/LS systems already treat env_get_bootm_low() result as phys_addr_t, while the function itself still returns ulong. This is potentially dangerous on 64bit systems, where ulong might not be large enough to hold the content of "bootm_low" environment variable. Fix it by using phys_addr_t, similar to what env_get_bootm_size() does, which returns phys_size_t . Reviewed-by: Laurent Pinchart <[email protected]> Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Marek Vasut <[email protected]>
Diffstat (limited to 'boot/bootm.c')
-rw-r--r--boot/bootm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/boot/bootm.c b/boot/bootm.c
index d071537d692..032f5a4a160 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -242,13 +242,13 @@ static int boot_get_kernel(const char *addr_fit, struct bootm_headers *images,
#ifdef CONFIG_LMB
static void boot_start_lmb(struct bootm_headers *images)
{
- ulong mem_start;
+ phys_addr_t mem_start;
phys_size_t mem_size;
mem_start = env_get_bootm_low();
mem_size = env_get_bootm_size();
- lmb_init_and_reserve_range(&images->lmb, (phys_addr_t)mem_start,
+ lmb_init_and_reserve_range(&images->lmb, mem_start,
mem_size, NULL);
}
#else