From 41fecdc94e3b3714f33a28c139f61cfa48bf16f9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 21 Oct 2024 10:19:26 +0200 Subject: common: Tidy up how malloc() is inited The call to malloc() is a bit strange. The naming of the arguments suggests that an address is passed, but in fact it is a pointer, at least in the board_init_r() function and SPL equivalent. Update it to work as described. Add a function comment as well. Note that this does adjustment does not extend into the malloc() implementation itself, apart from changing mem_malloc_init(), since there are lots of casts and pointers and integers are used interchangeably. Signed-off-by: Simon Glass Reviewed-by: Tom Rini Reviewed-by: Ilias Apalodimas --- common/spl/spl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'common/spl/spl.c') diff --git a/common/spl/spl.c b/common/spl/spl.c index 94657d00591..1ceb63daf31 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -678,9 +678,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) spl_set_bd(); if (IS_ENABLED(CONFIG_SPL_SYS_MALLOC)) { - mem_malloc_init((ulong)map_sysmem(SPL_SYS_MALLOC_START, - SPL_SYS_MALLOC_SIZE), - SPL_SYS_MALLOC_SIZE); + mem_malloc_init(SPL_SYS_MALLOC_START, SPL_SYS_MALLOC_SIZE); gd->flags |= GD_FLG_FULL_MALLOC_INIT; } if (!(gd->flags & GD_FLG_SPL_INIT)) { -- cgit v1.2.3