[PATCH] common: memtop: Fix the return type for find_ram_top

Michal Simek michal.simek at amd.com
Thu Dec 19 16:07:39 CET 2024



On 12/19/24 15:50, Venkatesh Yadav Abbarapu wrote:
> As the return type is "int" for find_ram_top() function and
> returning the "base" which is of phys_addr_t is breaking when the
> "base" address is 64-bit. So fix this by updating the return type as
> phys_addr_t.
> 
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu at amd.com>
> ---
>   common/memtop.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/common/memtop.c b/common/memtop.c
> index 841d89e0799..114ba64067d 100644
> --- a/common/memtop.c
> +++ b/common/memtop.c
> @@ -121,7 +121,7 @@ static long region_overlap_check(struct mem_region *mem_rgn, phys_addr_t base,
>   	return (i < mem_rgn->count) ? i : -1;
>   }
>   
> -static int find_ram_top(struct mem_region *free_mem,
> +static phys_addr_t find_ram_top(struct mem_region *free_mem,
>   			struct mem_region *reserved_mem, phys_size_t size)

You should actually align this line too to match (.

With that fixed feel free to add

Reviewed-by: Michal Simek <michal.simek at amd.com>

and I like to get this to 2025.01 version.

Thanks,
Michal


More information about the U-Boot mailing list