From patchwork Mon Mar 20 18:19:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 741114 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vn4336J3Lz9s0m for ; Tue, 21 Mar 2017 05:19:11 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2FADBC21CB1; Mon, 20 Mar 2017 18:19:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 9C6ABC21C80; Mon, 20 Mar 2017 18:19:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DE895C21C80; Mon, 20 Mar 2017 18:19:00 +0000 (UTC) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by lists.denx.de (Postfix) with ESMTPS id CE38BC21C75 for ; Mon, 20 Mar 2017 18:18:58 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id n141so19136951qke.3 for ; Mon, 20 Mar 2017 11:18:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=vZ51pp4+N/dJ4JRhOxaTgL7aXgQDTMZ+3pUoA5wnfw0=; b=IAB3IuT7Gh1XhW5noQQR0/sgHNmlHC2ChQlUM5ZXfSiP3slKuRerSlsPESStzAlyN7 VFLWUQerK4MvmJbLRYOEEbQCrB0qZKEXYb8Gurs8dsYk795Y9/RirIMDTr+KrLnYLXKg B8mhdNCgxHvY9li8wN70APw0d+P2qoFq41V2uu432fFVCAnh/PEYZUen4kesr0u5q2Gd EjASwzMm0COwAH6RmyIdiURoB2hSqNhC/Ax43GNv2XrhS0AvuLl1rUBa6wKnJtjoCCZ0 ApxCjrFmb/fVnoTQocwigfEnSzbDRaoh5QNJXDoR4FGFL0jpRo11hdC80rc4GmMXE8Vi 4LwA== X-Gm-Message-State: AFeK/H2DPvDgEoba/VZcd215CDF+S3mYUDC4/HeHaa/gnahByl96g+HL3hVPT+tVHxaa3Q== X-Received: by 10.55.170.212 with SMTP id t203mr26229566qke.53.1490033937599; Mon, 20 Mar 2017 11:18:57 -0700 (PDT) Received: from bill-the-cat.ec.rr.com (cpe-75-180-228-133.ec.res.rr.com. [75.180.228.133]) by smtp.gmail.com with ESMTPSA id t47sm5272035qte.45.2017.03.20.11.18.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Mar 2017 11:18:56 -0700 (PDT) From: Tom Rini To: u-boot@lists.denx.de Date: Mon, 20 Mar 2017 14:19:27 -0400 Message-Id: <1490033967-27115-1-git-send-email-trini@konsulko.com> X-Mailer: git-send-email 1.9.1 Subject: [U-Boot] [PATCH] spl: Correct call to spl_common_init() with SPL_STACK_R_MALLOC_SIMPLE_LEN X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Signed-off-by: Tom Rini --- 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)); 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; }