]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spl: Correct call to spl_common_init() with SPL_STACK_R_MALLOC_SIMPLE_LEN
authorTom Rini <trini@konsulko.com>
Mon, 20 Mar 2017 18:19:27 +0000 (14:19 -0400)
committerTom Rini <trini@konsulko.com>
Tue, 21 Mar 2017 11:14:17 +0000 (07:14 -0400)
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>
---
Changes in v2:
- Fix thinko pointed out by Lokesh

common/spl/spl.c

index d98b9fcb9ade2285b50caedbce7483db5ded78da..0d1e08245f6afa70392f3d8715f1cf0aa75c8d8f 100644 (file)
@@ -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(CONFIG_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;
        }