From patchwork Thu Apr 16 05:01:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 1271492 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.a=rsa-sha256 header.s=dec2015msa header.b=BXgeRSV/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 492nCp5lgkz9sPF for ; Thu, 16 Apr 2020 15:02:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E308819EF; Thu, 16 Apr 2020 07:02:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="BXgeRSV/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9E1AA819AB; Thu, 16 Apr 2020 07:02:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 46072805A4 for ; Thu, 16 Apr 2020 07:02:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=masahiroy@kernel.org Received: from oscar.flets-west.jp (softbank060142179096.bbtec.net [60.142.179.96]) (authenticated) by conuserg-09.nifty.com with ESMTP id 03G51pVZ004851; Thu, 16 Apr 2020 14:01:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com 03G51pVZ004851 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1587013314; bh=llK7ucdV6l29SVHcYBwVjdkQcSIKiRClJR4mIiEoomg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BXgeRSV/69BwQSCffqNvhh96TJQcxT8h1PJh8uYC8GaWkReuNy8hBrLcpI8h41L26 CMrqIY6GdtgLKHq6mu0HYL1mfqr9D7LIwS48pOuq5cAxA7IRML2A7HI8a8KcyQljaM Uu0/PCKhiqk9Ntxf46XLfvQqpyOITlDiWHCeN9mW/p8cQNoZPcc6ULPsk7Mjrw/9Ow Pw0f/0KU8UmJCHiLro7948+5irFkW7aIqRHufl5YWBc/XT2G5x4fPj0kBH/gchEAZF pO2i5NUIKTMEASWiAAqNR/sT7+EtFGc0ecetKhp8Ae+sYA1lOv/ibIv+A8Z18Fldt5 GM7YMt7494EfA== X-Nifty-SrcIP: [60.142.179.96] From: Masahiro Yamada To: u-boot@lists.denx.de Cc: Masahiro Yamada Subject: [PATCH 1/2] fixdep: handle CONFIG_IS_ENABLE() and friends for TPL Date: Thu, 16 Apr 2020 14:01:44 +0900 Message-Id: <20200416050145.492334-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200416050145.492334-1-masahiroy@kernel.org> References: <20200416050145.492334-1-masahiroy@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Since commit f1c6e1922eb5 ("spl: dm: use CONFIG_IS_ENABLED to test for the DM option"), CONFIG_IS_ENABLED() handles CONFIG_TPL_* options, but fixdep still cannot because it hard-codes the "SPL_" prefix as follows: char tmp_buf[256] = "SPL_"; /* hack for U-Boot */ Take care of the "TPL_" prefix too. Signed-off-by: Masahiro Yamada --- scripts/basic/fixdep.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index c9277d782c..555dada47a 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -103,7 +103,7 @@ #include #include -int is_spl_build = 0; /* hack for U-Boot */ +char tmp_buf[256]; /* hack for U-Boot */ static void usage(void) { @@ -230,7 +230,6 @@ static void parse_config_file(const char *p) { const char *q, *r; const char *start = p; - char tmp_buf[256] = "SPL_"; /* hack for U-Boot */ while ((p = strstr(p, "CONFIG_"))) { if (p > start && (isalnum(p[-1]) || p[-1] == '_')) { @@ -260,7 +259,7 @@ static void parse_config_file(const char *p) while (isalnum(*q) || *q == '_') q++; r = q; - if (r > p && is_spl_build) { + if (r > p && tmp_buf[0]) { memcpy(tmp_buf + 4, p, r - p); r = tmp_buf + 4 + (r - p); p = tmp_buf; @@ -419,8 +418,11 @@ int main(int argc, char *argv[]) cmdline = argv[3]; /* hack for U-Boot */ - if (!strncmp(target, "spl/", 4) || !strncmp(target, "tpl/", 4)) - is_spl_build = 1; + if (!strncmp(target, "spl/", 4)) + strcpy(tmp_buf, "SPL_"); + else if (!strncmp(target, "tpl/", 4)) + strcpy(tmp_buf, "TPL_"); + /* end U-Boot hack */ printf("cmd_%s := %s\n\n", target, cmdline);