diff mbox

[U-Boot,v4,3/8] board_init_f_mem(): Don't create an unused early malloc() area

Message ID 1445259003-15896-4-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Simon Glass Oct. 19, 2015, 12:49 p.m. UTC
Change the #ifdef so that the early malloc() area is not set up in SPL if
CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually
be used, and just chews up stack space.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Changes in v4: None
Changes in v3: None
Changes in v2: None

 common/init/board_init.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Tom Rini Oct. 24, 2015, 9:15 p.m. UTC | #1
On Mon, Oct 19, 2015 at 06:49:58AM -0600, Simon Glass wrote:

> Change the #ifdef so that the early malloc() area is not set up in SPL if
> CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually
> be used, and just chews up stack space.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/init/board_init.c b/common/init/board_init.c
index 1c6126d..e74b63b 100644
--- a/common/init/board_init.c
+++ b/common/init/board_init.c
@@ -50,7 +50,8 @@  ulong board_init_f_mem(ulong top)
 #endif
 	arch_setup_gd(gd_ptr);
 
-#if defined(CONFIG_SYS_MALLOC_F)
+#if defined(CONFIG_SYS_MALLOC_F) && \
+	(!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYS_SPL_MALLOC_START))
 	top -= CONFIG_SYS_MALLOC_F_LEN;
 	gd->malloc_base = top;
 #endif