From patchwork Fri Apr 13 05:06:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10339433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA0D8604D4 for ; Fri, 13 Apr 2018 05:11:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2B3528622 for ; Fri, 13 Apr 2018 05:11:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6D28286AA; Fri, 13 Apr 2018 05:11:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5640828622 for ; Fri, 13 Apr 2018 05:11:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752223AbeDMFIf (ORCPT ); Fri, 13 Apr 2018 01:08:35 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:54947 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751123AbeDMFIa (ORCPT ); Fri, 13 Apr 2018 01:08:30 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id w3D56lg9029209; Fri, 13 Apr 2018 14:07:01 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com w3D56lg9029209 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1523596021; bh=cjztX1j5+aS/xNoPt3VdmJkM/tSdo2S0cdWoku0J/mU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XdcbZEhhjPITqsUaSco1zXryhmKG/HtaySb5L9jS2QhuoGOmlICFx27Cd0SuMgzAc 7cFIblwnJH4WAKDl/I0+bXmtAcYtWOgryPWhaDNBQJ6scXoEjPERSfylA6qfFEDJUh u4iobrqQqzmSFkHx68AeMyydFMdxY9tUJAjtU1+BbgetDlJqyseGniybEgDKFLcB0z JWI6cMyxiasslpXb4AZk3tnz7Di5NIU99wNDq6N8SenTqc9B3BK5yeRHqqFfjbYXR0 7ECGfrbFv0ac26RATqBWka1ezIkomtN9zQAw/Cji8igFzL/Dh5tZrLdspH0P5onveK HlMqXtTDH/Eug== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Linus Torvalds , Sam Ravnborg , Ulf Magnusson , Nicholas Piggin , Kees Cook , Emese Revfy , x86@kernel.org, Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 15/30] kconfig: expand lefthand side of assignment statement Date: Fri, 13 Apr 2018 14:06:24 +0900 Message-Id: <1523595999-27433-16-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523595999-27433-1-git-send-email-yamada.masahiro@socionext.com> References: <1523595999-27433-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make allows variable references in the lefthand side of assignment. X = A Y = B $(X)$(Y) = 1 This does 'AB = 1' Do likewise in Kconfig as well. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None scripts/kconfig/zconf.l | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index c68ca56b..ae33e9b 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -114,6 +114,13 @@ n [A-Za-z0-9_-] yylval.string = text; return T_VARIABLE; } + ({n}|$)+ { + /* this token includes at least one '$' */ + yylval.string = expand_token(yytext, yyleng); + if (strlen(yylval.string)) + return T_VARIABLE; + free(yylval.string); + } "=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_RECURSIVE; return T_ASSIGN; } ":=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_SIMPLE; return T_ASSIGN; } "+=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_APPEND; return T_ASSIGN; }