]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common: memtop: Fix the return type for find_ram_top
authorVenkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Fri, 20 Dec 2024 03:07:42 +0000 (08:37 +0530)
committerMichal Simek <michal.simek@amd.com>
Fri, 20 Dec 2024 08:17:43 +0000 (09:17 +0100)
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@amd.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Link: https://lore.kernel.org/r/20241220030742.1745984-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
common/memtop.c

index 841d89e07993dad0ff10e9002acfdc352c5aed83..bff27d8211ede1aaf161ff85e39d2d11b00802fa 100644 (file)
@@ -121,8 +121,8 @@ 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,
-                       struct mem_region *reserved_mem, phys_size_t size)
+static phys_addr_t find_ram_top(struct mem_region *free_mem,
+                               struct mem_region *reserved_mem, phys_size_t size)
 {
        long i, rgn;
        phys_addr_t base = 0;