[U-Boot] spl: Correct call to spl_common_init() with SPL_STACK_R_MALLOC_SIMPLE_LEN

Submitted by Tom Rini on March 20, 2017, 6:19 p.m.

Details

Message ID 1490033967-27115-1-git-send-email-trini@konsulko.com
State Superseded
Delegated to: Tom Rini
Headers show

Commit Message

Tom Rini March 20, 2017, 6:19 p.m.
Calls to IS_ENABLED() on a non-y/n option will always be false, even
when set.  We can correct this by adding a new bool value that is set
based on the conditions required for SPL_STACK_R_MALLOC_SIMPLE_LEN to be
set instead.

Fixes: 340f418acd11 ("spl: Add spl_early_init()")
Reported-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 common/spl/spl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Lokesh Vutla March 21, 2017, 2:39 a.m.
On Monday 20 March 2017 11:49 PM, Tom Rini wrote:
> Calls to IS_ENABLED() on a non-y/n option will always be false, even
> when set.  We can correct this by adding a new bool value that is set
> based on the conditions required for SPL_STACK_R_MALLOC_SIMPLE_LEN to be
> set instead.
> 
> Fixes: 340f418acd11 ("spl: Add spl_early_init()")
> Reported-by: Lokesh Vutla <lokeshvutla@ti.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>  common/spl/spl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index d98b9fcb9ade..91180d4b476b 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -227,10 +227,11 @@ int spl_early_init(void)
>  int spl_init(void)
>  {
>  	int ret;
> +	bool setup_malloc = !(IS_ENABLED(CONFIG_SPL_STACK_R) &&
> +			IS_ENABLED(SPL_SYS_MALLOC_SIMPLE));

This should be CONFIG_SPL_SYS_MALLOC_SIMPLE. With this change it works fine.

Thanks and regards,
Lokesh

Patch hide | download patch | download mbox

diff --git a/common/spl/spl.c b/common/spl/spl.c
index d98b9fcb9ade..91180d4b476b 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -227,10 +227,11 @@  int spl_early_init(void)
 int spl_init(void)
 {
 	int ret;
+	bool setup_malloc = !(IS_ENABLED(CONFIG_SPL_STACK_R) &&
+			IS_ENABLED(SPL_SYS_MALLOC_SIMPLE));
 
 	if (!(gd->flags & GD_FLG_SPL_EARLY_INIT)) {
-		ret = spl_common_init(
-			!IS_ENABLED(CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN));
+		ret = spl_common_init(setup_malloc);
 		if (ret)
 			return ret;
 	}