From patchwork Tue Dec 11 11:00:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153431 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475837ljp; Tue, 11 Dec 2018 03:02:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/XAnoHiYx7pZoRiP0zZqtPVgWURi8DZ26KHS7+VMzAdRKTohva9KV2bkGrAgga/Bf1S66vk X-Received: by 2002:a65:564b:: with SMTP id m11mr13781911pgs.216.1544526171980; Tue, 11 Dec 2018 03:02:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526171; cv=none; d=google.com; s=arc-20160816; b=eZWGac77C/4RBS53whPTGmISPUf6sfVj/7EsHDKwMOdF6ZVXeiRFfVtD98e5cfHiYU LJp3U6C8YvBcoacNjx1u1Ncee8vHwDdBZIGhbscNJlfvwRV2XTO6RU7Afu8rIggLtkOL hoj6mwTov3X7XYHFI1mvWo+ISW+0cTSKmTLUqzUOqUnwGy1MwCryidnytL9tY3CdELdU /EMjuJI+sGbfQ9tudrEhjrvXFhAKLkt0FTp5bFTRw4bMoQFvBMrdZiIrNdK6obyNY+BK YS1t9AxYO/JZpduPYKekKvGaNxdXsK4C3EhzeAQcRNieymVS8rFwKiB4xA+XVMkmMbry WPjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=mncNGlTLnxVAb43S35qXiIVRiqRfjL/tj0kSfjctkSE=; b=n5eU8RyJIBFC8boT2HMd4Kfr/sRPaPTAw1BGcJWM0MIUBWOQExOKogkpDytre8ExP6 uZ0SWpsAcQUhu1y7MBS9stWONC342ZBGk0ocrEg/rYLoRMmR8PiLzvm8Ttk9rePImA+W Dga16cJioVGNEVOkxxkHEZnOnQE9zwbLEcq3LdvmWVb9HeSnsqvXINbZDosCnvmQ9awd BS/mzm/UyWE6qx3eulCgWbIM+peJcNmVxgJhmr6LA3WHXF86/I09CXRFeqLBikS9G8Pj +pgVNn1RmAfTrCZ4RSNNExPRFxGkO7yXomeFee8r0OT/NOJLOEsVsgZiihav2peIxXOZ xkyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=LJLQScGS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m75si11661993pga.432.2018.12.11.03.02.51; Tue, 11 Dec 2018 03:02:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=LJLQScGS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726851AbeLKLCt (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:49 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36705 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbeLKLBn (ORCPT ); Tue, 11 Dec 2018 06:01:43 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5c017210; Tue, 11 Dec 2018 20:01:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5c017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526074; bh=mncNGlTLnxVAb43S35qXiIVRiqRfjL/tj0kSfjctkSE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LJLQScGS95+DMJ0pUZ4F4ERVfNgBRNdjKdJyw2Jh4YoLQ90RWS1fJqRp1ns8p0P3d 3bp8GbpD9Y1wWxsww3uUKJBrjm0BSjNPhQCnUanWCRK48hKpp63ZQtM8PRZkQEgufF mvrwB2ZRU7VjpeA4mF5+K4B4RTLMYXvkundt6I+l0qbbAx8UHgnMwifvvUgjitNtDo XWbNIDGfNJevM2Wi4y03cvQFURMNHmvoWdx7DA3mPeIQJEbYpcKR4e/WulRz+1x6h4 P7MeFFffvsqg7Fc6wNHG2rQeqDrAKi0ZxlmXn3IJNCxXTKS4MEa3uJaCoI39oedbVn yd799o5r/5Bzg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 01/27] kconfig: fix file name and line number of warn_ignored_character() Date: Tue, 11 Dec 2018 20:00:44 +0900 Message-Id: <1544526070-16690-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, warn_ignore_character() displays invalid file name and line number. The lexer should use current_file->name and yylineno, while the parser should use zconf_curname() and zconf_lineno(). This difference comes from that the lexer is always going ahead of the parser. The parser needs to look ahead one token to make a shift/reduce decision, so the lexer is requested to scan more text from the input file. This commit fixes the warning message from warn_ignored_character(). [Test Code] ----(Kconfig begin)---- / -----(Kconfig end)----- [Output] Before the fix: :0:warning: ignoring unsupported character '/' After the fix: Kconfig:1:warning: ignoring unsupported character '/' Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 25bd2b8..eeac64c 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -73,7 +73,7 @@ static void warn_ignored_character(char chr) { fprintf(stderr, "%s:%d:warning: ignoring unsupported character '%c'\n", - zconf_curname(), zconf_lineno(), chr); + current_file->name, yylineno, chr); } %} From patchwork Tue Dec 11 11:00:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153421 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp474663ljp; Tue, 11 Dec 2018 03:01:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/XbukC5bNWV7s4dbfktCJrRC9F5ZQMww4ZKvpWhtGV2HSFEq0GRIbsy1ig+QBSF9chEq59M X-Received: by 2002:a63:6cc:: with SMTP id 195mr14319888pgg.52.1544526110109; Tue, 11 Dec 2018 03:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526110; cv=none; d=google.com; s=arc-20160816; b=bCaxsu/syx69f7/TaQbI0yCk6+15TtmDt3GFzC53Nl3/XxnpY8MNvGD8kOscQntQfB X/RKZUsFbGEyXFYkM0ni2wQBAAUxuPwhLkSfQU2BaroEM3yuP0Bwo2TXXj2KyQow4ZRr I30S7xGZwG4lMmaaq3reAuYAqLty8MxRgnq7dbDYJsLw3ppjJ+zZTSQdfrsYUsrTeF+Q v4gq6jgzUGaosjCgllK+nVYnuTBBfSfcZIan43XiS+X83KDZwwOSw8wcnz8lObB5bD52 hnPZNmTnXZkZf0qdZnp25z5R61cTKv2nJuwT9YIbswq9eOE5OnL6iTQLnU8X1EkUkJqM 4r7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=zSehz5sKi9aix5amSrmINjlwYVsoU6nXsGRPKh0lMLo=; b=sSKWPDy6sPQla08BBNWADsdwp6Qx0NrHdz0ncCStc9xOvcH9VGEsQjcODI8fSnAXAK /LMx7v0eSZ/iexhY4LWHiyQ4Br6NfiXLxwO1pOQkvO4ZULfe2G7mnPXSBJjG3JGHIkyF FDgJh/yiGYKEM7SoLn5Emer+UqG2PvzN7X/en6lRlVNgbowsIdvCLN9lskITc7xIjwEr STT+NDRyoHwHLWxJmCfm3PjKMLf52B6859bB9oER/31WKsOPG6cM2t21wnpdyBd4wuH6 uuSAIvX3cytfzdPzpy+IKs3fEW1qvlRhkhsz4kZ0A1nlyOqC2c6NBoIE+69wnEXUjFvp XhdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=p3CC9cwI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si12985331pfb.166.2018.12.11.03.01.49; Tue, 11 Dec 2018 03:01:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=p3CC9cwI; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbeLKLBt (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:49 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36709 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbeLKLBo (ORCPT ); Tue, 11 Dec 2018 06:01:44 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5d017210; Tue, 11 Dec 2018 20:01:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5d017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526074; bh=zSehz5sKi9aix5amSrmINjlwYVsoU6nXsGRPKh0lMLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p3CC9cwIqHRRCTrxDoVz7UVsAF5ni8sCGpeXSVsCaMb7fKKF/yga3871nqKxDOa4/ qToXkmvKntTs26LhMaSi46tBN+hOyqUF6UlJktpYkMGKqDdF/i3QhmdqQWUiMPiqui 1JBbB3XZ0OdXz7rARLFINBWFg0GriUxnI/49UUIdJp+xSFkp5w7WZV7B9cf8W3Gw8u 9m8m2ITJU3tmioLGXFjLYIQw2xDkIlu46VC6VnYJQG7LGOTZL4yeggPJkHhL0j+ica ZPMlN1DrpsE4lN04bQRI0n5Vv7sge295ax+unKo1EIH+UJttHubRmN/Z3KwP3QkPm/ AZP3gWXx+Nv/w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 02/27] kconfig: fix memory leak when EOF is encountered in quotation Date: Tue, 11 Dec 2018 20:00:45 +0900 Message-Id: <1544526070-16690-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org An unterminated string literal followed by new line is passed to the parser (with "multi-line strings not supported" warning shown), then handled properly there. On the other hand, an unterminated string literal at end of file is never passed to the parser, then results in memory leak. [Test Code] ----------(Kconfig begin)---------- source "Kconfig.inc" config A bool "a" -----------(Kconfig end)----------- --------(Kconfig.inc begin)-------- config B bool "b\No new line at end of file ---------(Kconfig.inc end)--------- [Summary from Valgrind] Before the fix: LEAK SUMMARY: definitely lost: 16 bytes in 1 blocks ... After the fix: LEAK SUMMARY: definitely lost: 0 bytes in 0 blocks ... Eliminate the memory leak path by handling this case. Of course, such a Kconfig file is wrong already, so I will add an error message later. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index eeac64c..c2f577d 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -221,6 +221,8 @@ n [A-Za-z0-9_-] } <> { BEGIN(INITIAL); + yylval.string = text; + return T_WORD_QUOTE; } } From patchwork Tue Dec 11 11:00:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153439 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476719ljp; Tue, 11 Dec 2018 03:03:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/VVybbWSaLwUhsGl6roPBEYOwzKEHqUkA0lHy4R1dTsKBTWDR7zRzzSrV3qYr89lrOf8/9s X-Received: by 2002:a17:902:9045:: with SMTP id w5mr14983490plz.32.1544526220838; Tue, 11 Dec 2018 03:03:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526220; cv=none; d=google.com; s=arc-20160816; b=htD3bmWFQHx+amjAzvplZuwpRI8YJ0D2xC9gTXzMmFXb6YGWQIc2xeOR7og6TGLrSO 6Dq4GK3u4xo3GEWjGctEvq8W/w/7acyz7bzalrLcLnvwKTc1axW79+cnFE2CLxm6em0+ ijNTVPEG2HCSsqHrrBX6GUDs+EszNXEaFUqrR9k10g5mZ1SVbAn/itaQ04EzByZ65swf E0qU5Sy1s/RmA7Csua0a4gMquaH8AURrEu04HQwnY9gnCwSmYt+3/p1p3zP90rOZ8k3K +Rr+U9WtDAeAsUyS3+YJFBB+VyJ30f85AiSBUyctd0SuVA+FxkZ3mDs+p2r1vWFnUyoS 3LTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=pSsIoFlZj5d5mg6c+vr71NzXFRGXFCZclWcK8cltYHM=; b=GPxFvB3Ulc0dgsaR6c6G/rzGg0gA682NLi7UdOrW1xilQ7AJkeMeC6tn8AHKm4kIR+ 3Y29TPsaDwh7yu0ZOuyv9m2wcI72lN4L4MAbYPZA7safvuZKEf1QfLkChPjsrWTsK1lN fJVK/BKqdOAnZ/S2kPX4YR4ETmFbWvS5itmjKxZrDZ6fLN+LgWoXB1p3nB76oa/no2jk JHpueeFUEtSxchteAv9u1lSQVJoszj0/To4ixwvIUb8r6uKnPYBsCd69WB/TnL0sd92u 0k5OXIENlk/C72DjbeQ/O9zn71WpRRbPEgtU9T9VGoJQasuu81QhptRHKF4h7VDqAxR4 WSZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=untWr3Gp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si11931615pgg.433.2018.12.11.03.03.40; Tue, 11 Dec 2018 03:03:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=untWr3Gp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726451AbeLKLDg (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:36 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36644 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726542AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5e017210; Tue, 11 Dec 2018 20:01:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5e017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526075; bh=pSsIoFlZj5d5mg6c+vr71NzXFRGXFCZclWcK8cltYHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=untWr3GpnaXWKHOiLx20lIAx1fr7m45U2/IR1ysuZ4TeHec4j70v35Ja58HIVUM9V gGLPewbOoRLGxNp7XV+bJLv8Y0e/wG0MrUdEbsqFjV9ZLJMXv6hEUx1h2rkgnl/fca 94dmE3Xz21hLrOHIQjzdt/a4goOJcPgwYaS1Ov7/AQ5/byAZV61cPaoKuXpPtDGuFI LdgfFDSWTIjliesccDgKjy/NNJZ0E35Nir8VWAw/VeGrxksR9vVnwEQ1Tg36JgmR4p vbvqwtpFg3MbAYcCXR/FO2Tjmv3/nw4/FE0o5E5yMzrkQ5pMk0um+C8cJL/tR4hIh3 ILxNTfTKM6koQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 03/27] kconfig: require T_EOL to reduce visible statement Date: Tue, 11 Dec 2018 20:00:46 +0900 Message-Id: <1544526070-16690-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All line-oriented statements should be reduced when seeing a T_EOL token. I guess missing T_EOL for the "visible" statement is just a mistake. This commit decreases one shift/reduce conflict. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 22fceb2..c28f1a8 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; static struct menu *current_menu, *current_entry; %} -%expect 30 +%expect 29 %union { @@ -461,7 +461,7 @@ visibility_list: | visibility_list T_EOL ; -visible: T_VISIBLE if_expr +visible: T_VISIBLE if_expr T_EOL { menu_add_visibility($2); }; From patchwork Tue Dec 11 11:00:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153443 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp477183ljp; Tue, 11 Dec 2018 03:04:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/X0LigTvA59S642mVeaS08v9JsoyYT0DjjXTU1Gc8cGjyjSH4VfCadv054cAcOq4DAEbvw6 X-Received: by 2002:a17:902:264:: with SMTP id 91mr15743140plc.108.1544526245741; Tue, 11 Dec 2018 03:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526245; cv=none; d=google.com; s=arc-20160816; b=U46POVkOSqXX5fc5qKYoktX1IT6iKxnrHVNM49KkgJdvjN9Lsqwfna95W73pbf8/44 mWyq43TNeJXRmgcLb5dctMgiOaH/oQvsZSlRIyas51ZSUUclfArVKRynlVMoYKUQgzFU 6jKDuleqDDaLcNF4o7YfjILNJnqyKHhWJ3GbUOg2mqdggwenK3jYL7Z2y4JnVbPPJ13J I74D0uW654yytkYWxVX/dgg5C0H6SmB5EZRdVdtdyd5ZbLLgoW9UN/CHCcO7JUhnRKXo 8W7GuNI9/WOsnQNPj/ZlzyqOgHIUoes0h7SfsFS5lyCnXZpzw6kHSOeukYBksJDn0Swx SLVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=cPNIocFPv6H2B1/axiyEmh1v2T8MzKJrKLpW+Gd7HY4=; b=m2Zesjp2eHYacdHvILZCiD51WYC2z5BHtaH5M1rzJlSKCpLpaV02odqSQLeqMcaheq GolvRQLUbz6aHOOfAhfAQZ9Tfp5r1kZxFJERTt0TVgU4HKlgeOFSrkzEkPhSrGs2DbKY whadqWLQDf4GhrFz51HSMDqioHjSBYzj6ortBHvAuH1/mvRslIdMfg7sK9r55pJK6RAW vtG5SoysOnJF8E/LIwV/9OkIfU5DUHniyUkqnk/lHTOGfdNGdkIdqXYVi3ztp0AEkMIu Q5SYP4ypJhq0bWHkJg9srGPcxkX/Dhid6scgPI3sSzCLx61Nj6OUWYfpqxhpEkZj43hy lLyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aQyKw+Ok; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si11641412pga.352.2018.12.11.03.04.05; Tue, 11 Dec 2018 03:04:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aQyKw+Ok; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbeLKLDv (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:51 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36642 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726484AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5f017210; Tue, 11 Dec 2018 20:01:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5f017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526076; bh=cPNIocFPv6H2B1/axiyEmh1v2T8MzKJrKLpW+Gd7HY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aQyKw+OkRScUYtir2EO0JVObH/6GLARoAK541skZO7sdQ9dYTR8G7M9qfhecDQacM /Bas/azrcocY4XSQq/ZwjRNbOU3rxbeR1KU1ztfeERDycYEc0vZdhaeTAda7GcyhXb cI5RD1pSnsnx+2DGh0VDDa1L+yiPTMb4tmCHUEKeZ4IyTy5SHtKyWDRk+zprqa/37l Erl5cESk0yVhoSAAG03pIRdVZoiL+8EcUUxqqs8ej04+xuXmUbc0M0w1995h22WMGf KcVxZK8oCfDVqUVOtcK9JC68emG0HzmRhln2lBJ83zmyJzT/670IqbD/P9dvONXfjG Rg4xSal139oZg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 04/27] kconfig: remove unneeded pattern matching to whitespaces Date: Tue, 11 Dec 2018 20:00:47 +0900 Message-Id: <1544526070-16690-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Whitespaces are consumed in the COMMAND state anyway. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 6 ------ 1 file changed, 6 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index c2f577d..709b774 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -88,12 +88,6 @@ n [A-Za-z0-9_-] return T_EOL; } [ \t]*#.* - - -[ \t]+ { - BEGIN(COMMAND); -} - . { unput(yytext[0]); BEGIN(COMMAND); From patchwork Tue Dec 11 11:00:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153437 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476433ljp; Tue, 11 Dec 2018 03:03:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wv5YYedR0B9rOatET9l3SFguQpNh0JKtLR3ZN6u+cabv2GNEKGLN6WzyjBQiDznTCxUO+j X-Received: by 2002:aa7:80d7:: with SMTP id a23mr15651973pfn.86.1544526205299; Tue, 11 Dec 2018 03:03:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526205; cv=none; d=google.com; s=arc-20160816; b=qc8v89QehDcVtrBs+l0qEddNRokesT8H5u9tE+JEIPKJoCp+Cvw0J9zZ2jmu7bdaLG zoPrWHWq7I7JoejAW6MDa/djGyIcxGZ6kbawTMrcE6mhK4VXruq4Z0Efz1U7FZzKZepb S+raVYDlfBAS8Kak327YYHSda1nSvIwTC7wPzOWmnu9lQQViKJDBxUde+nqzNCZasF95 oIkSDT6sdMAYpW/DeSlBDdx4iwykJVX5E71uZ7psE6EiN0w2qP5K5tNxLPNER+xk9wGC 22rwmeab+zH37Bl9NlWuo4eP2fhQMeZKzeuV0GWpZ6nJS2kLWQiFw/F1bimpmmomNkh7 NhmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=BD7gkp9jc0123daEs5SstZ3+OOaAroiN8LQ5Qi2IAvY=; b=LsLjlWclkDbCIz+JXYSpDLXFJ6S6XA1DTBNpaWV0qKQYAwWAS2HdIu9nhsifxXoQ2p 6UTS5t/YntpLOhBpfhg/nG1lrBdHw2T7DDhfq+pYXdeXlbgp/fdqmQmh7h8SbOVSqvEA WaENOxwUu9Sfm5HD+k9GCEgN/ZpNhfjqvOrEclDy/qUBvFlqJayWQfRlp5OLTb4pkICa JPF5LfzU68pVcK9FTD6eTK+Qs+8+If9o+JG+e9wcrhXfkc4TjzSYrD9hcwbrtSJEn773 qbJ6KlZKXt9zPr4/YJBGKukUdf3NfbxwgC1pH7CcXc2JKvYXhN2u+j3Z9R9kG+lz6U++ lbuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vtQymvHw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x5si11065485pga.440.2018.12.11.03.03.24; Tue, 11 Dec 2018 03:03:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=vtQymvHw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726671AbeLKLBn (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:43 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36638 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726432AbeLKLBm (ORCPT ); Tue, 11 Dec 2018 06:01:42 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5g017210; Tue, 11 Dec 2018 20:01:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5g017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526077; bh=BD7gkp9jc0123daEs5SstZ3+OOaAroiN8LQ5Qi2IAvY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vtQymvHw5414mFzvRj4NBDaSSaiZJNO7bEecnyK3MbfpDeYHkNJNVE01rTLfLs8q+ ea0MP3E/3j51FfqurmdvhFbO7kxQy8daYTbOcw0IV2OkbVHLXRJm1n3Gic1LzS0UON EJygDGqoNfO8IXY1Xx6w8RJtqIt0iW1WPK4cPZEGiROo2YTKPZev3vK/LrpVa76qfk 608AqTbSqicDriywfFqdwjvkJvTpJKczGK6gWUyBpvG0KPEOM9JJsL8vSLQZ7oeDLD gIEOW1lSfqOqZCc3amFXoFno6Yg/4WGwHnoO+R8JvO/An2LT7e3ktJPTTp7n7BRdXk fzcH/5b7X9yRg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 05/27] kconfig: refactor pattern matching in STRING state Date: Tue, 11 Dec 2018 20:00:48 +0900 Message-Id: <1544526070-16690-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here, similar matching patters are duplicated in order to look ahead the '\n' character. If the next character is '\n', the lexer returns T_WORD_QUOTE because it must be prepared to return T_EOL at the next match. Use unput('\n') trick to reduce the code duplication. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 709b774..b7bc164 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -182,19 +182,9 @@ n [A-Za-z0-9_-] { "$".* append_expanded_string(yytext); - [^$'"\\\n]+/\n { - append_string(yytext, yyleng); - yylval.string = text; - return T_WORD_QUOTE; - } [^$'"\\\n]+ { append_string(yytext, yyleng); } - \\.?/\n { - append_string(yytext + 1, yyleng - 1); - yylval.string = text; - return T_WORD_QUOTE; - } \\.? { append_string(yytext + 1, yyleng - 1); } @@ -210,8 +200,10 @@ n [A-Za-z0-9_-] fprintf(stderr, "%s:%d:warning: multi-line strings not supported\n", zconf_curname(), zconf_lineno()); + unput('\n'); BEGIN(INITIAL); - return T_EOL; + yylval.string = text; + return T_WORD_QUOTE; } <> { BEGIN(INITIAL); From patchwork Tue Dec 11 11:00:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153434 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476102ljp; Tue, 11 Dec 2018 03:03:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wf2yGXEXo5LziNmKDAdgfGAOR4F4FmHVH+XS6CgfI+53EPpgbfkgguEuPYbPVrecOoN4EM X-Received: by 2002:a62:8e19:: with SMTP id k25mr15863779pfe.185.1544526185773; Tue, 11 Dec 2018 03:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526185; cv=none; d=google.com; s=arc-20160816; b=E8t3XMfHn0b2Du/GQfcBR74QgRFM/Q5P/s27B4sf5VUyl6UemV9yQlxKRol57rTxo3 YmluGXOEs3PcioZRdo2gUgEDbZqwclye26ckVkpHnTXWSiKY+Z6u644Lp6N22er2h7Se eZ02hngbi9QguBVUtJPE9aai7/kuhUhfmTttFFexFxuj22RkJwwhpd/VeI9blJwx+HVI Naba7q2gYx2dt4PxyQWFk3VuGnka8dIhPpgsvsxvx7WdsobreKOuR3I9Pm3F8p1512hB nGu1uSPBsTbK1Fct8RgvJ0pwygH0rLqQPc7CiZXZZEnar8gdc6TdPTqR//j6m6RbaB28 q9yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=G/ycLbPhkj1QR+lVIupeFYkdZAVqycrRJHc5wDj08Ec=; b=bfB1Gvq/Yyy5VaOfmx/CK2BWOhxaeT17q+NVKIghb+tBYiTB4xcfyw8D+lodO8nkkW Imftz+I/xGxK/kaplsa/dEIE3kr8lHBvvVrcpFyvQwv6MWVrPVKjIFQIhf5TZ7XtQg4x qxSTeH9hb9uy3cI+TfX/M0ywcUCmL5pvieHnNVKiqTX93drkpconnQvYw0e3TV1JHGse XMPRF4qobOfy+d+3asequOMlPY3E4HWw+CzNZ34zb4rvg7b+tJnH1kbEbcHEsG7CtQDc sfuvvjNDBn46UzoYRt05l0R9jEGnSV57cwXe9ifoQf3BiUv87sq1IYBOOh9QFlDX/0M5 6YpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Na+UKrL6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w185si13403408pfw.122.2018.12.11.03.03.05; Tue, 11 Dec 2018 03:03:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Na+UKrL6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726455AbeLKLCp (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:45 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36702 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726606AbeLKLBo (ORCPT ); Tue, 11 Dec 2018 06:01:44 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5h017210; Tue, 11 Dec 2018 20:01:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5h017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526077; bh=G/ycLbPhkj1QR+lVIupeFYkdZAVqycrRJHc5wDj08Ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Na+UKrL6DVf5o+zTz2mscnsaOfrJg/RpbNiehbQPgf1+O9/dl0AO8EB0bnm84MXzi UoxIcRd2bkcrQAMoap9eh9FgE0MA2Y1GgndVnQ0+fqG1FG/mZv0NrfT2JN/3XhDuBa /HYby/XiCXzsI2EpEXncyyyVqlCRwPV6Y7w+HTXRtTdwwUTZ79Tzb57T+2oZW0b4gf 4gXaVcl1OAh1eZYaDXRKtJjJFdRgTcsVdRtmRBawetptn5kFNvkqPb5j65mRbCNmZJ bV++p3kPVJvf1bLFkTZBnYDCDS3uG2vOkbDPiEL76ZJqWI4FnHxYBEx1hIDDE4OLW9 6As1Z/EdpfQUA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 06/27] kconfig: fix ambiguous grammar in terms of new lines Date: Tue, 11 Dec 2018 20:00:49 +0900 Message-Id: <1544526070-16690-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit decreases 8 shift/reduce conflicts. A certain amount of grammatical ambiguity comes from how to reduce excessive T_EOL tokens. Let's take a look at the example code below: 1 config A 2 bool "a" 3 4 depends on B 5 6 config B 7 def_bool y The line 3 is melt into "config_option_list", but the line 5 can be either a part of "config_option_list" or "common_stmt" by itself. Currently, the lexer converts '\n' to T_EOL verbatim. In Kconfig, a new line is critical as a statement terminator, but new lines in empty lines are not important since empty lines (or lines that contain only whitespaces/comments) are just no-op. If the lexer simply discards no-op lines, the parser will not be bothered by excessive T_EOL tokens. Of course, this means we are shifting the complexity from the parser to the lexer, but it is much easier than tackling on shift/reduce conflicts. I introduced the second stage lexer to tweak the lexer. Discard T_EOL if the previous token is T_EOL or T_HELPTEXT. Two T_EOL tokens in a row is meaningless. T_HELPTEXT is a special token that is reduced without T_EOL. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 21 +++++++++++++++++++++ scripts/kconfig/zconf.y | 18 +++--------------- 2 files changed, 24 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index b7bc164..847ba42 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -16,6 +16,8 @@ #include "lkc.h" +#define YY_DECL static int yylex1(void) + #define START_STRSIZE 16 static struct { @@ -23,6 +25,7 @@ static struct { int lineno; } current_pos; +static int prev_token = T_EOL; static char *text; static int text_size, text_asize; @@ -268,6 +271,24 @@ n [A-Za-z0-9_-] } %% + +/* second stage lexer */ +int yylex(void) +{ + int token; + +repeat: + token = yylex1(); + + /* Do not pass unneeded T_EOL to the parser. */ + if ((prev_token == T_EOL || prev_token == T_HELPTEXT) && token == T_EOL) + goto repeat; + + prev_token = token; + + return token; +} + static char *expand_token(const char *in, size_t n) { char *out; diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index c28f1a8..02bfc62 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; static struct menu *current_menu, *current_entry; %} -%expect 29 +%expect 21 %union { @@ -111,9 +111,7 @@ static struct menu *current_menu, *current_entry; %} %% -input: nl start | start; - -start: mainmenu_stmt stmt_list | stmt_list; +input: mainmenu_stmt stmt_list | stmt_list; /* mainmenu entry */ @@ -141,8 +139,7 @@ option_name: ; common_stmt: - T_EOL - | if_stmt + if_stmt | comment_stmt | config_stmt | menuconfig_stmt @@ -193,7 +190,6 @@ config_option_list: | config_option_list depends | config_option_list help | config_option_list option_error - | config_option_list T_EOL ; config_option: T_TYPE prompt_stmt_opt T_EOL @@ -293,7 +289,6 @@ choice_option_list: | choice_option_list choice_option | choice_option_list depends | choice_option_list help - | choice_option_list T_EOL | choice_option_list option_error ; @@ -443,7 +438,6 @@ help: help_start T_HELPTEXT depends_list: /* empty */ | depends_list depends - | depends_list T_EOL | depends_list option_error ; @@ -458,7 +452,6 @@ depends: T_DEPENDS T_ON expr T_EOL visibility_list: /* empty */ | visibility_list visible - | visibility_list T_EOL ; visible: T_VISIBLE if_expr T_EOL @@ -484,11 +477,6 @@ end: T_ENDMENU T_EOL { $$ = $1; } | T_ENDIF T_EOL { $$ = $1; } ; -nl: - T_EOL - | nl T_EOL -; - if_expr: /* empty */ { $$ = NULL; } | T_IF expr { $$ = $2; } ; From patchwork Tue Dec 11 11:00:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153445 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp477341ljp; Tue, 11 Dec 2018 03:04:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/VA/DOCWSEs9j9XSrqOnNG7vBkR9jGWhNi1sWw56Fq3p9qcHlkZ8WX/k7lnFLUjjf/+X7Nb X-Received: by 2002:a63:82c6:: with SMTP id w189mr14393725pgd.344.1544526254424; Tue, 11 Dec 2018 03:04:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526254; cv=none; d=google.com; s=arc-20160816; b=flYjxeEtgngAg4x856nDlEldPa8bQ/VfeY7FT3M3DM/4sSUHipvyYC9PBhHtb6g2ro EAXI/pKQ6W64GJEDkigJ9plHNBzsoXga6Z4ImM51/3Nxvrtezn0icIbp0qTAee4sJvyC jb//PcHFT4pQogkJUR2hSo3TkZHlQawtvoiqKcA6NXnWitcOfpVkHT4GRH1tpl/TFEHF HhbeCgCBAnVeJTbHY1AEXqo9zeh1MSyEz7CH5gM3IIISinUGP4HQLJT0Q5X/xpIF31Ae Q8inW0yc4GQO1YtHjvk/E2PS663u1Cqeeu3DQOTPfdS/9VcRnwQwJFMxZCpMtAcJUsKA oijw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=p0w0tcziiu1RUOelBJBhML/iGcu+25dug+WgEnUJYVU=; b=jycuLk9jRpXmreChcP+m6CJNz6MRXtHMESsHjuShnjwu6Dh3WxEKZzFXrxT2k1A8Of 5cxs1lJWsE+/KOlx/0avH0EfbTMsahFb3NMnYaba0Qm2qtuwIycyyNp1gS4Kf4C9VTYB vOYKONYTJi/o5KxmQx+L8RKMpGM1BLt90isz8MMYeexEbzPFEQ+c1urP/egM4zJgExtc pyACXSyzWfCX7CqYTnaL+211F0uid+xbuqRZAHHodF+tdjTlkchM6bPyXP74fwf8NWI0 /Jny4/5uSrUO9A7/bYII6kifpo54qEfFW6z5tvY2Y3OgqgGaZofCPgRyhJ7C13aJN8Vv C4BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JvHjF6IC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h67si13289142pfb.146.2018.12.11.03.04.14; Tue, 11 Dec 2018 03:04:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JvHjF6IC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbeLKLEM (ORCPT + 31 others); Tue, 11 Dec 2018 06:04:12 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36637 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726445AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5i017210; Tue, 11 Dec 2018 20:01:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5i017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526078; bh=p0w0tcziiu1RUOelBJBhML/iGcu+25dug+WgEnUJYVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JvHjF6ICUbcoEz58vc6whQRxo/YWVfZ++9W/VWLCbG8xTWjif0kR/FmA92Did9lm6 T0rUuAkhn0vKx5/to80deKlE/F1BcjdrkyFzw//oCYSuakgP0ugN0L1KGR5IHaB4mD qQTJt8FVh8mccWCWtrV+7prmWMxYp/Yi1i2Xb0k7DPfA1P4fHzFp+7IZnJR1HYVMi0 5w+zMiYFk39s52qhirfJ1kFv++9zru1Kpo6rYxPgaeEsKeQL6sClyRBXyd2+bI671w 3XJTOFDk4Na0w9xkQFOxNl0yi6Kc5KOAL1WldORdFJuGdDM889wyXJzgE1c4Axv6b+ WR49TcAKds4AQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 07/27] kconfig: clean up EOF handling in the lexer Date: Tue, 11 Dec 2018 20:00:50 +0900 Message-Id: <1544526070-16690-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A new file should always start in the INITIAL state. When the lexer bumps into EOF, the lexer must get back to the INITIAL state anyway. Remove the redundant <> pattern in the PARAM state. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 847ba42..9038e97 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -178,9 +178,6 @@ n [A-Za-z0-9_-] \\\n ; [[:blank:]]+ . warn_ignored_character(*yytext); - <> { - BEGIN(INITIAL); - } } { @@ -262,6 +259,8 @@ n [A-Za-z0-9_-] } <> { + BEGIN(INITIAL); + if (current_file) { zconf_endfile(); return T_EOL; From patchwork Tue Dec 11 11:00:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153438 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476518ljp; Tue, 11 Dec 2018 03:03:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/VhcUUk96m1oaeH829mcq3XsogXibKUDwEDFB65HBKMonk/LymuyrdJxViCv4KKRaUHW4y9 X-Received: by 2002:a63:8149:: with SMTP id t70mr14516523pgd.172.1544526210318; Tue, 11 Dec 2018 03:03:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526210; cv=none; d=google.com; s=arc-20160816; b=rnjXg8tDQUJmdJgZpoPbu0aj3ACMfprbcAWVm0ByEqcEBa9cNRRaa4LfyN3qLYSePg bfKzWZmfHyYHP3FXb3becwrIA31B6e6WtUIrHrEvS6HQTouBKhKV6p9W4QrIhwari5BY qNQLVqvddV5uDIh1LPIi08qSSLy5TWkfU+qjKzgIbEmNrzst9kX1j2VPPVsAtgKjD/zb RU1dbOREyJVa7kseWoa/IuTD2uBa5A8RgDNTPBBR1ucsOIQuYpZeLezf2oZKzLmn8T8K GuYXcXW9DboSWsXLmq6AFnGaWAhcoJ3VPq1G8N4GBoLYC+UhEt4QpKXnz/BJu8FFd2uE M+Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=MlQs798fD3HimILsVIH/RMuv643LnBHtKXQ4IW5SZaA=; b=gJECqrFgBc6HVrpNvFly+N8OZ/RM/rO8u+yV8nb78IFjZbanC+bbfjC5DUzIR9Em9i yy4MuC4ufIIe6XyTyiqBRQuGcBuo9LGx8HxuVdwhjN+O06Ads28qYeIwA6vCkYSldYbV AzALj11lDuloymlE5SrZeqIVh1a2vzQnbWLw0A0XY5m4M6U2ApHbdq2pARQgGGJDqUzl 6VOr4tTCTn641Vofa104LoL9GRHpaZws4k+DjgGOAio5+402qVb4WS7qvcvGnssRAN0Y MYci7g1IieT/nRARcAwM4qUJzDbh/uSWJ/rMOT5W9074C5NYvibQa6BXKpD0GSw4GIXU Axfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=eVPfCaXP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si12406084plc.320.2018.12.11.03.03.30; Tue, 11 Dec 2018 03:03:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=eVPfCaXP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726405AbeLKLD2 (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:28 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36641 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbeLKLBm (ORCPT ); Tue, 11 Dec 2018 06:01:42 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5j017210; Tue, 11 Dec 2018 20:01:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5j017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526079; bh=MlQs798fD3HimILsVIH/RMuv643LnBHtKXQ4IW5SZaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eVPfCaXPPe7n1cnw+Knr9Zsq/PwgTsxnsnIO5JAD4eHK/rYj0WDkkaK40Kp0rxyIg muVXnZI3Ns4yE5N7y+ntHxoycTkegNmRZz5CTUT94jAAp2yvnGcq5TrcnyzZxCQJcX ri7UlEK76wP/224x5G01yaW9VCUadESFBq8+BVTZblzNPtA8h0fqzKVit+IP8Am1pg j97Yalx81TBg5Gdy+mDFFVqfCDo5ppNwo3WolTchGo36DFrg09UCYvzzPJ9ZvSWUYV 9Wngqbp0WRqENMXNSoV+Bw2tyKtPDNoZu6wLNZIDxP+FRXNj1CbY/4Bsz28e9W6aFu Lvx8vVgCKILNA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 08/27] kconfig: warn no new line at end of file Date: Tue, 11 Dec 2018 20:00:51 +0900 Message-Id: <1544526070-16690-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It would be nice to warn if a new line is missing at end of file. We could do this by checkpatch.pl for arbitrary files, but new line is rather essential as a statement terminator in Kconfig. The warning message looks like this: kernel/Kconfig.preempt:60:warning: no new line at end of file Currently, kernel/Kconfig.preempt is the only file with no new line at end of file. Fix it. I know there are some false negative cases. For example, no warning is displayed when the last line contains some whitespaces/comments, but no new line. Yet, this commit works well for most cases. Signed-off-by: Masahiro Yamada --- kernel/Kconfig.preempt | 2 +- scripts/kconfig/zconf.l | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index cd16551..0fee5fe 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt @@ -57,4 +57,4 @@ config PREEMPT endchoice config PREEMPT_COUNT - bool \ No newline at end of file + bool diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 9038e97..5046d3c 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -78,6 +78,13 @@ static void warn_ignored_character(char chr) "%s:%d:warning: ignoring unsupported character '%c'\n", current_file->name, yylineno, chr); } + +static void warn_no_newline(void) +{ + fprintf(stderr, "%s:%d:warning: no new line at end of file\n", + current_file->name, yylineno); +} + %} n [A-Za-z0-9_-] @@ -261,6 +268,9 @@ n [A-Za-z0-9_-] <> { BEGIN(INITIAL); + if (prev_token != T_EOL && prev_token != T_HELPTEXT) + warn_no_newline(); + if (current_file) { zconf_endfile(); return T_EOL; From patchwork Tue Dec 11 11:00:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153420 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp474605ljp; Tue, 11 Dec 2018 03:01:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/UDvj0EycFVArYwbjoh8j+S4klcapM2SVB+nUkeTkbKdHOLUQWbj8DGA0EMfRpxH9mE6+BF X-Received: by 2002:a17:902:8f83:: with SMTP id z3mr15176962plo.328.1544526106797; Tue, 11 Dec 2018 03:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526106; cv=none; d=google.com; s=arc-20160816; b=IBGV45X3DyTTiBkrKW28QJCv59MGouyvKgAxxFNpAxLBoCNQGiZAWgQI3VI8G8CYo2 FRzdIz9AkuJUdv4h8GkSfBTLSa1FEbHwDAKJbVpGh3D2s9Gub7mQDZ9lCKIsZju4+BqA cczpjrRoY8ty/pUc93W7g6oHEvyOrL49moPSL2hNtrWwOpraDyWInPHm3M1w1V9gQEpI sIfloLv9BN3Tdy8RE+Vcao8bqLcXUkOcU+QhOJquHF7KqxstZ36lUTwgYE5B5TZ9r5CL vfUUFwX/VKO7vKTwR4kq+IDMxeCzvDv4ZawXGvmyh2KuSdyWnbemAql/7zpAeAGKTRo9 EzSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=iNmCjGIrzgz6jSnY2pvpjlrVb4D8VRpuL9G+9Lp30As=; b=sTqbXQWz1p9rnQpsE7QZRYdoGNcHcEOLE7J2SeZRexk8Hw9RpwCNk0gdtMimJB9/Ag Rbe8KVm8vTztdyNyVQpdo42CjTH/1Z8ORXyiSHIl2MfIkImwrBbn/uMa1/td+LJffC/+ BJt2bUh3uNe1U6dw+OnO2EZY3RfV3cYrA+hcDjYfTXCAXa+VLFdYwG8Pq6UxEiprs5LZ hhAyrtmUWvfIW3fnHw4+U9PLaWKVHWH+Ld8XFiM72bgOEf6IN9hR6QsTS4YnX8VWsY+V JawH7xOOhokU2cPxgRehrxJY+IWJhv6qWXFqsEEKVmgN/FNRlNxkT23fdY1WWp1qj6y2 wnUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BrC0ZLWv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o2si12985331pfb.166.2018.12.11.03.01.46; Tue, 11 Dec 2018 03:01:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BrC0ZLWv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726697AbeLKLBo (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:44 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36639 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbeLKLBm (ORCPT ); Tue, 11 Dec 2018 06:01:42 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5k017210; Tue, 11 Dec 2018 20:01:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5k017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526079; bh=iNmCjGIrzgz6jSnY2pvpjlrVb4D8VRpuL9G+9Lp30As=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BrC0ZLWvRAna3/LVGAwk2xylPzxljOlcd89yaJUcQgdso53UDFXQUYrBvMyarImXy edydHjjz2LO4QMZ2zNrJ8c/A2dwK6wwC+jooYlRwX9R4tFDODf6co72JODXF5W/eep PHjHTESyqBfRjXAOQkzGtn+G5lvKeywVIo++jbE6HvJ5/6e6DyL6FZ3h4cAN2cX+sH IR8FKsMFqxSXTQPjov3Y0dyqILcG6MmOMFySPW7aljn+EfPad7u7WHTnyJMbo5vgtG ERXIgVTtXLjgj6CDqpHZdAyMEbt79RzWVA3HHK3nBeDCqyEMyRNMhaCcDogqT+KesS VYKOQzzN7KK7g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 09/27] kconfig: remove grammatically ambiguous "unexpected option" diagnostic Date: Tue, 11 Dec 2018 20:00:52 +0900 Message-Id: <1544526070-16690-10-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit decreases 15 shift/reduce conflicts. The location of this error recovery is ambiguous. For example, there are two ways to interpret the following code: 1 config FOO 2 bool "foo" [A] Both lines are reduced together into a config_stmt. [B] The only line 1 is reduced into a config_stmt, and the line 2 matches to "option_name error T_EOL" Of course, we expect [A], but [B] could be grammatically possible. Kconfig has no terminator for a config block. So, we cannot detect its end until we see non-property keywords. People often insert a blank line between two config blocks, but it is just a coding convention. Blank lines are actually allowed anywhere in Kconfig files. The real error is when a property keyword appears right after "endif", "endchoice", "endmenu", "source", "comment", or variable assignments. Instead of fixing the grammatical ambiguity, I chose to simply remove this error recovery. The difference is unexpected option "bool" ... is turned into a more generic message: invalid statement Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 02bfc62..cef6123 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; static struct menu *current_menu, *current_entry; %} -%expect 21 +%expect 6 %union { @@ -94,7 +94,6 @@ static struct menu *current_menu, *current_entry; %type expr %type if_expr %type end -%type option_name %type if_entry menu_entry choice_entry %type symbol_option_arg word_opt assign_val @@ -127,17 +126,9 @@ stmt_list: | stmt_list menu_stmt | stmt_list end { zconf_error("unexpected end statement"); } | stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); } - | stmt_list option_name error T_EOL -{ - zconf_error("unexpected option \"%s\"", $2->name); -} | stmt_list error T_EOL { zconf_error("invalid statement"); } ; -option_name: - T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_IMPLY | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE -; - common_stmt: if_stmt | comment_stmt From patchwork Tue Dec 11 11:00:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153430 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475621ljp; Tue, 11 Dec 2018 03:02:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/XpF6HJRKf5zRaNktB5Rd4G6PmG1He/vLdjDeUy8RnMCnu6DsJy9e0ioGL27vVtQG/oenIP X-Received: by 2002:a63:981:: with SMTP id 123mr14246569pgj.444.1544526158947; Tue, 11 Dec 2018 03:02:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526158; cv=none; d=google.com; s=arc-20160816; b=ABB38f6TQMzRnaIpDuYmlv8WfnAQZw1+1a4Q3Rfbs1temgh5yXisA1K78oNHJ+SEzW ZGuWsG2aBJ/B0vFy9a5A9ptX/NwF1TpIRV7d8CUG7UYbLlz8SEuO5zCH54ny7S89Il8G Z8ZIZnWndtLChA3Mv99eTC9l+K9aRjvSamozgD7EhDlBBlOKpI4O6TFGKngvF4OPtFmX 5yxN7eYQKqAEqSyu5h4rK9cUHNHkbuhApT+av5+Own6nei3oF1JMutWpBlPL5QGb1gZO pz1JeBqvqZj1uLAclSXFLf7MpjtuTtB2dEMmLMC9LzgEk/amTQRH7L+7E2kGzSwWX793 IKuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=azx+pnU1cXACJgUuzQ4P92840L9XD8VA47ps+ZrPfdo=; b=y0WxAjuyzvpEnyjBSJE5ZZ1/nlqsEasML3nZHTt7Le569t9qjUu7PndLQOgK/MQjHY z8KJ7x0UzoLQZb1XxPBEdG3OrFF/voDCK9M1gzdyrZUdsjxfKfuCZrf961kuf0T9aSS2 ouCQMCPxEKh4go4e00GM2ixbUScD3aDbzhAnCCRYoe3inruas8e9e+scYM94HwhMB1kT kJS5nvgmxOpLvqEc9I8KQTKlKi4g6V73eeq26iAF8oVW4hbka57mYU6z8twZ+JZN8yxA 7Y6iUxLOJ74d8O1kSgJhe4t4PkoLAfetla1YDJ3WJwmvfkwR430wqTihLsLUlwwE3Vm5 VjrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Yi532WXo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a5si11840815pgg.120.2018.12.11.03.02.38; Tue, 11 Dec 2018 03:02:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Yi532WXo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726716AbeLKLBq (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:46 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36701 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbeLKLBn (ORCPT ); Tue, 11 Dec 2018 06:01:43 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5l017210; Tue, 11 Dec 2018 20:01:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5l017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526080; bh=azx+pnU1cXACJgUuzQ4P92840L9XD8VA47ps+ZrPfdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yi532WXoQr1Nj9YE15y7UbTWaAHCmFQLxNrYlPd1hGNIzqOnIH/bnSmFKsA5wsoMH TwS6z0h/Pl64Dm5/8NZf7Om3zuq0H6BNSNbNZZnWI2gA4ND4kVwgx2OG+JH2vIq4kk pwM7lnHJ8tZBxyKiqN60WZ1KqriEaaBukqXrrmoaP+WeLO2wlALkcHtvblpJ5R4dCU vho2rC7EfxPhfjTUxqY3EQUCmJ7XtozHjNAYNO1wevXORwI7udyblg0x+F8ocM5QR1 MzPnU54F5Ndkgc6QHFbmhAOMvZgqGuyUp/4MUAWLQlf2Q/bAnva1iE690Luf62tviM L3yAaQ1X8GYWA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 10/27] kconfig: remove grammatically ambiguous option_error Date: Tue, 11 Dec 2018 20:00:53 +0900 Message-Id: <1544526070-16690-11-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit decreases 6 shift/reduce conflicts, and finally achieves conflict-free parser. Since Kconfig has no terminator for a config block, detecting the end of config_stmt is not easy. For example, there are two ways for handling the error in the following code: 1 config FOO 2 = [A] Print "unknown option" error, assuming the line 2 is a part of config_option_list [B] Print "invalid statement", assuming the line 1 is reduced into a config_stmt by itself Bison actually chooses [A] because it performs the shift rather than the reduction where both are possible. However, there is no reason to choose one over the other since the code above can be written as follows: 1 config FOO 2 3 = Remove the option_error, and let it fall back to [B]. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 10 ---------- 1 file changed, 10 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index cef6123..a92f167 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -31,7 +31,6 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; static struct menu *current_menu, *current_entry; %} -%expect 6 %union { @@ -138,12 +137,6 @@ common_stmt: | assignment_stmt ; -option_error: - T_WORD error T_EOL { zconf_error("unknown option \"%s\"", $1); } - | error T_EOL { zconf_error("invalid option"); } -; - - /* config/menuconfig entry */ config_entry_start: T_CONFIG nonconst_symbol T_EOL @@ -180,7 +173,6 @@ config_option_list: | config_option_list symbol_option | config_option_list depends | config_option_list help - | config_option_list option_error ; config_option: T_TYPE prompt_stmt_opt T_EOL @@ -280,7 +272,6 @@ choice_option_list: | choice_option_list choice_option | choice_option_list depends | choice_option_list help - | choice_option_list option_error ; choice_option: T_PROMPT prompt if_expr T_EOL @@ -429,7 +420,6 @@ help: help_start T_HELPTEXT depends_list: /* empty */ | depends_list depends - | depends_list option_error ; depends: T_DEPENDS T_ON expr T_EOL From patchwork Tue Dec 11 11:00:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153446 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp477483ljp; Tue, 11 Dec 2018 03:04:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/W/p+ahDLixqMEc9tt1PMaJ4LfaLgot868G3z+OmxMRQL6QvobpluJFXp6iQmy2CoMuhcAe X-Received: by 2002:a17:902:66e6:: with SMTP id e93mr15250718plk.92.1544526261302; Tue, 11 Dec 2018 03:04:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526261; cv=none; d=google.com; s=arc-20160816; b=FUF6/MVOiduQL0cZxYReBjfohy990EMr96jV2dlWaO9ce4PyPYf1SmkQk8eEon1PlE feJLGP7wG6liJ8qk7tFwUHO6uc89xzAEF0ZXrciAoueKDGEZktTge2GYTYnNOHy/5qBy 8HKyqYxLE1Sb61b6B5eZcGviM/pHRz5PsfZResue1xqvW3q7pxtVWZUQxx6BHwdOHsNX bQApC2RmbOSB2xqRA39yAhMlEcHvlOYYr8B/A1TAZpVarj51DxvVZ3bx2la3pQMEqrXu awlFxcR2Vm4mL64g5/ooX6Nfov5P5XrmBRq9l3vfURZhVoFsQRsOPic/izTNvdilXgZy jMkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=m3JoEOK4UyUXfBThLu/B9ZmqSbB1lwgoGZ57SfpSYt0=; b=BKNYFFukY21xzyJKZ0MjLcfKiyqhF4rCtQcsoc5qeLMlaL0dFBPLNI/UDtQx5VHcJw goohtTwAra07WRC+YPCOuNEaHld/O9Z82nClqV36I9KC/sRVhg0BrtdqpmAnn4nNYk6k 3F1IlvvorLxqbJl9OBLmgoUZj4PR0oa0AGG78XAYdJPZC0B9jCbeIflyjzw9OQDHNDXO O6cm8n5R6iG4Q3Wd3R99EEkTRo7BVZ1AnJkhbullixqv9qvJ7wA8BquJBeGstcfN8Vyu NqSIuLj20uBsvSpbBrqJKTWVCvRe4wJ80DPKA69BrP4jnl1n7f2Q5AoEnvYh8Vk9roLx zSDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mwktbhaK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si11713692pgd.428.2018.12.11.03.04.21; Tue, 11 Dec 2018 03:04:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mwktbhaK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbeLKLES (ORCPT + 31 others); Tue, 11 Dec 2018 06:04:18 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36636 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5m017210; Tue, 11 Dec 2018 20:01:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5m017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526081; bh=m3JoEOK4UyUXfBThLu/B9ZmqSbB1lwgoGZ57SfpSYt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mwktbhaKxhmw4kY34rRDJAxpw9leZBIb9cARnQonmsiG9nNbnMVN16D0mJR6L1kba TwW5um939Ev7xYqLI4/+Nzzjwh+cAFgVNIzw4fuWesfNe/oN27iu6LjPuClBm+7PbV h/4SL+0Bzz0bQ7aWOCzQLjIsEuEkzviEwA+kEIqNBJJEMcxdU4oQVbLjNpmE+c1uKj X/y9fxXI4mSMrH9kPauyG/cgduRN5p0lJ73mkz218dHkCVCjA2mP/f/+xiXimO/QXd ChCChhfo1FCEl6T2vrxtNs4pi93MxHxuRoKOKpboUqzRm9PnaKMcJUwZIUqlUj8QZD v51cCD6xhP/ZQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 11/27] kconfig: remove redundant if_block rule Date: Tue, 11 Dec 2018 20:00:54 +0900 Message-Id: <1544526070-16690-12-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code block surrounded by "if" ... "endif" is stmt_list. Remove the redundant if_block symbol entirely. Remove "stmt_list: stmt_list end" rule as well since it would obviously cause conflicts. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index a92f167..dcbf643 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -123,7 +123,6 @@ stmt_list: | stmt_list common_stmt | stmt_list choice_stmt | stmt_list menu_stmt - | stmt_list end { zconf_error("unexpected end statement"); } | stmt_list T_WORD error T_EOL { zconf_error("unknown statement \"%s\"", $2); } | stmt_list error T_EOL { zconf_error("invalid statement"); } ; @@ -330,14 +329,7 @@ if_end: end } }; -if_stmt: if_entry if_block if_end -; - -if_block: - /* empty */ - | if_block common_stmt - | if_block menu_stmt - | if_block choice_stmt +if_stmt: if_entry stmt_list if_end ; /* menu entry */ From patchwork Tue Dec 11 11:00:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153441 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp477019ljp; Tue, 11 Dec 2018 03:03:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/UROfqRNrtR29qjKWeXUivZTJwP8wBgZVElGMXogQBkRAFby7kUAKimIrFjpG2HbYjucRzi X-Received: by 2002:a62:435a:: with SMTP id q87mr15640696pfa.109.1544526236129; Tue, 11 Dec 2018 03:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526236; cv=none; d=google.com; s=arc-20160816; b=XqsLdpyhFuK7WVfH6TshncRn+MSH4xEFdVvNwF68LiHRX61cz2ILYfbAPl3nWimdVB ECgCF0eGFvEfGZ2Qj+DC+GzwLdzpWbl9wSgC6+p2qzU6oLY1e29eeb54qmlhpEU/KXWL Ix/2GZw7WfYunYnks+8cl3LOdhpMPr9SRT2chgwlOib1NZOa36o8RqbIR75h+NHNuLPj i9OASfouoBd7CRBJbuTTpbJxwwvcMdruuP3IFyO4WKmIFLXaXxB3TalXG2gAFoSi84h9 tonBd8kWW0lay9LQl6jHIukMLfhs95CMp9OjZJ4gMirKBKTKh0Tt0HRKl/LsorNA8Vcn zLbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=IcgexvJt38ljGJvWC/WL37DAl0lX6I5rv6Nx+cZ8BoY=; b=AzeasCJ1o+hjwLB/6GJpv46xKrGG+kpF8w4Hc2TKKiDT9CpGw57oOcIzvavRXB68Qy dOoUTl76DWXNDOWPQl9D/L5Zb7WfJntpmsRCNIJD0nZGi+QVJREYG8iAPyRlNwNG5pt/ rQU/LR3T67Hi9lp//0iZjm1WZyfrKT9CUtBaA7T53r8mbqsEaO2qXuDVAqpvaqsNgwP9 47QrIj3+cyFlamukzuG8OwusKGtAbLbKBfxQj3HcKxHC5zA1l2wsj5wZCdmPTykL+6wZ v7I6BPQfwIzjKMyxAH3ZC7VbRKsG4LjU9OSF1jkl4OvQ65L38G7P5ircD7hvz2I6K2lm mm+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=TpCMKpVQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i12si11695666plt.213.2018.12.11.03.03.55; Tue, 11 Dec 2018 03:03:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=TpCMKpVQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726613AbeLKLDw (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:52 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36640 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5n017210; Tue, 11 Dec 2018 20:01:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5n017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526081; bh=IcgexvJt38ljGJvWC/WL37DAl0lX6I5rv6Nx+cZ8BoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TpCMKpVQu6uoOgsl2+dJOlS6AOqf77CrWSP3g4VykvNco1bqMVvyZTWwEHXU7kYug DgRf8oEUZpP2RInI4I1ob1HQsSB83VwTE66RIvVeTUEZ56ugH9bj9CS0MLsJsCpT2n jwzyuXILeblIN9gZWBMBE6OB++8m7uLktDmsxF5kViY3PIIBWfJMHbzLu5+rsElxn4 ro9kpgV6Zb4UG646p4oxyXma4oWBxbARg23JGuUBDmQfiWc9AGHLREmeAJss1CsXdj Oss1IVYe9Zw7u7l4K15DcXMoqYIuHPKSiPX7e6J1t589bS5QrSRZht+4dsSN43hJ8m J3lVo0QNUW7+g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 12/27] kconfig: remove redundant menu_block rule Date: Tue, 11 Dec 2018 20:00:55 +0900 Message-Id: <1544526070-16690-13-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The code block surrounded by "menu" ... "endmenu" is stmt_list. Remove the redundant menu_block symbol entirely. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index dcbf643..eeb449b 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -354,14 +354,7 @@ menu_end: end } }; -menu_stmt: menu_entry menu_block menu_end -; - -menu_block: - /* empty */ - | menu_block common_stmt - | menu_block menu_stmt - | menu_block choice_stmt +menu_stmt: menu_entry stmt_list menu_end ; source_stmt: T_SOURCE prompt T_EOL From patchwork Tue Dec 11 11:00:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153435 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476294ljp; Tue, 11 Dec 2018 03:03:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/VK1eaUxVJ7ifgOOslKyqhjblBgMWfvlNEMwNBs7qGGupTDV5zPcwbD5eXdb5MLT2fdDKHb X-Received: by 2002:a63:e950:: with SMTP id q16mr14149354pgj.138.1544526196064; Tue, 11 Dec 2018 03:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526196; cv=none; d=google.com; s=arc-20160816; b=xxk7Wf4LeTJN/PFaUooyhJAM9P4uv5B3BxH69vwAkPSIQtw2m1ARZbKJwDwsPE/z7Q TjpmTyKMdor12D0LMDGPVtcJIQKsdbF4p3BiSjUhjLfd3FcRburQMvyxa/q7PmgBuvXu oeSOr/UDIDYw0San5OMmEzqfEWu9LeimG3w83ekXUlqDyjRoD+KsqDWPZ5r/7KnuCAFJ DREOjGWJZoD4W995YkXmTi7NUc9H9H+45qrs+4sKLCRlgTzEYc4FKfLK1gHNr0k8QU2S hV7kcJE1TDi6/TMfWLRohq3gvc29ygeMWNhctmfay7Rvlbt5Qpb2LmOuRuUQMwQSi0Xv Z96A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=S7ukwX6NkoGsh6wmesUTz6h4J/DCsX6bNDq3MpJLeqU=; b=VzbOpEGHNeO4zQ+Wj9I/2fN33m5wGJrs6n4HrH4meEGXEIWzM5vZZzhnqIIwFNKtZL +nplZYG0lC/YhXWjk0tfFAi9SEbguKC7hth74ky5JR30k7w59QqH+DR4B+xsPFZSLwsk +kNaA/W+mb8ik6+4lVGrfKcHfcADzwPNpSbd5yx3JKI1mp15BQRidgHDk8CugHU0or1h MVUZ0OcxC6+V/1OyTBDAeBRIRfZkeIL3Tu6hZqxy+t1J0LEZU1mgvvtbGeAXz8zlIdyf QvgwyDCK4t87JNQ0stGwDyJzIYORGP9HCbrKbN4DLdqNI90XYqVUr1v1F6RGbToBvDVl ujvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=EjeE9NkR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si11652776pgk.101.2018.12.11.03.03.15; Tue, 11 Dec 2018 03:03:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=EjeE9NkR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726314AbeLKLDL (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:11 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36714 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbeLKLBn (ORCPT ); Tue, 11 Dec 2018 06:01:43 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5o017210; Tue, 11 Dec 2018 20:01:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5o017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526082; bh=S7ukwX6NkoGsh6wmesUTz6h4J/DCsX6bNDq3MpJLeqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EjeE9NkRQZByf0FXmq6z71dWwbxkAE/bleCS/A96rOjI5u/UbEoBmF2s68du9Me4t +eZVn0oOt+CoDDNj4xIMaEYRTjvnwx9QxFdewaJce2cQbye3aNAQZtCCw5Iszcik5G PVt3lTAxy6C7g2MLbyylyZ2W6RY8XC80ozYPw+nf3QNmdo0VkblH2NbHpGfh9exECg 7Q5s+KlH62M4je/Q9Is71f5aoaXf8+QIRwOFIJgtSJIKH09tFiiqpL76Mo0ngt3+KC SAQ+evHHrGqVMWaFYNTF99cejzopivFULDkCTtcFxRcgCS7wNYR2ZiWIvmiCN4wpvs i+YMce7aqMgUg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 13/27] kconfig: loosen the order of "visible" and "depends on" in menu entry Date: Tue, 11 Dec 2018 20:00:56 +0900 Message-Id: <1544526070-16690-14-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, "visible" and "depends on", if defined in a menu entry, must appear in that order. The real example is in drivers/media/tuners/Kconfig: menu "Customize TV tuners" visible if depends on ... is fine, but you cannot change the property order like this: menu "Customize TV tuners" depends on visible if Kconfig does not require a specific order of properties. In this case, menu_add_visibility(() and menu_add_dep() are orthogonal. Loosen this unreasonable restriction. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index eeb449b..7cc8244 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -341,7 +341,7 @@ menu: T_MENU prompt T_EOL printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); }; -menu_entry: menu visibility_list depends_list +menu_entry: menu menu_option_list { $$ = menu_add_menu(); }; @@ -357,6 +357,12 @@ menu_end: end menu_stmt: menu_entry stmt_list menu_end ; +menu_option_list: + /* empty */ + | menu_option_list visible + | menu_option_list depends +; + source_stmt: T_SOURCE prompt T_EOL { printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), $2); @@ -414,12 +420,6 @@ depends: T_DEPENDS T_ON expr T_EOL }; /* visibility option */ - -visibility_list: - /* empty */ - | visibility_list visible -; - visible: T_VISIBLE if_expr T_EOL { menu_add_visibility($2); From patchwork Tue Dec 11 11:00:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153419 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp474549ljp; Tue, 11 Dec 2018 03:01:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VOKzL2evjc1CNUAP7MC7xgOr8G21pGGyI8BLGDjjCA1Blri4yD3g8Yyy7C7SJXi9qzCxQt X-Received: by 2002:a63:396:: with SMTP id 144mr14356463pgd.68.1544526104302; Tue, 11 Dec 2018 03:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526104; cv=none; d=google.com; s=arc-20160816; b=ILOiMZigkygVl7+LOHfjh7cUq6tl83Y+8qOuk35XqFPv0LOCBHI+WZjl9qZpgWXTah 21A020C9SxkRPo1QT651RrdsR5YwBnaKdVmBmVNDnv9EMl6qepSMFmIbqB91ec8nUgq2 dCJ9uk8U+AKnu+0w3ab+qdqq3pLshmIMeVI9WVYv3TkIe+ewHBoABGpxhiqU/DWi3kGt VbypmjegxeS2snLB8zgy4wQ96pY0kSvL+kQ+wFfvNsxlG96MqLLJX8zfBMbVzdkwPzAL uXBpPUGx2A/md+tzmo0sYzyJSv6lRQrkYlikJAT6BgCUnZsxRAOPJvNum+L8UY3mJFRE PyyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=1t+Q4fwv0SRz2WilTNb/OLgd9pvAOdz79A9TL0DwMJ8=; b=Ttt7Vdi1M30GvApImBPzKkUjbQ0KyXS8W2LYau1e4mOpMk2umIQMb2Re0fq2NcY7Xk MZ2xYXR1DLQsQv2NdQiBi7Bl7tjFDjCU3UwlpIuuA0O8/Btaco9a4KhRXtA6E83Od/jJ oEyJhSKOBIy+DNI6etLsiDEPVjp75ttn6hW6xSbFn7k/dfo6hUtBzHVQgcglgkNXLNSy kIrw0vqWH5/mmUAdPSN2zckvbfafeeKxKgtFCwwpGR6LwerbP0A9f7I32dFIaLkRYQpj 1ynD2nYNCc12vOn8ihMtDnCg1AuwYHWDTlKIuXrBijUm79XXnVZcJknhLvXt9uP+wXUa jeDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=1Nk2d1fX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4si12431089pfc.234.2018.12.11.03.01.44; Tue, 11 Dec 2018 03:01:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=1Nk2d1fX; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726638AbeLKLBm (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:42 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36643 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726527AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5p017210; Tue, 11 Dec 2018 20:01:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5p017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526083; bh=1t+Q4fwv0SRz2WilTNb/OLgd9pvAOdz79A9TL0DwMJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1Nk2d1fX7ADINjEyR7E4QMZIWWLrhhJzFkvXc0QwOL1jgBEgl3uAjbseNp0Wfsf/Z rBuFgs9sWDTyyANy7FmlfqhFmngmMkiDSiGarBC6SRIlftMxdW+7wWqofE/KW/9cVo ZvsdtROPWUd3bN+pye77gTxzGmcDrkk1BZeMt7WqdXpVYhkjwliNQAN4CU+i3fSQJ2 2JvvnrKbrpsA3VSLt/8DwJi1hWlS3V76mgeSUayQgz0Z0mgoVpHy8A1srp7HuDm3dt AFDIFcQlH5Fte6ZmPGciie3PR3WNsVMT1sguxqzyTumAKBW/hessqZvybOmlyiJhJP avrjdrm8IEEng== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 14/27] kconfig: rename depends_list to comment_option_list Date: Tue, 11 Dec 2018 20:00:57 +0900 Message-Id: <1544526070-16690-15-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now the comment_stmt is the only user of depends_list. Rename it to comment_option_list Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 7cc8244..7a4bc58 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -379,7 +379,12 @@ comment: T_COMMENT prompt T_EOL printd(DEBUG_PARSE, "%s:%d:comment\n", zconf_curname(), zconf_lineno()); }; -comment_stmt: comment depends_list +comment_stmt: comment comment_option_list +; + +comment_option_list: + /* empty */ + | comment_option_list depends ; /* help option */ @@ -408,11 +413,6 @@ help: help_start T_HELPTEXT /* depends option */ -depends_list: - /* empty */ - | depends_list depends -; - depends: T_DEPENDS T_ON expr T_EOL { menu_add_dep($3); From patchwork Tue Dec 11 11:00:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153444 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp477250ljp; Tue, 11 Dec 2018 03:04:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/VGHnNRkJXRyAM6HwQ1QeW0qER7mAYa0Mshfan6N4JC0S3tEjcJNK1Tp2dkktqRQ3rFXg0L X-Received: by 2002:a17:902:887:: with SMTP id 7mr15501239pll.164.1544526249786; Tue, 11 Dec 2018 03:04:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526249; cv=none; d=google.com; s=arc-20160816; b=U4HWZG0R+ZyA73qI67V+HXIiwV14DNeYGdPMwHd4WBoBp4Luvtz6c5ytyXciM61g4l wr+eANdX8BJA/5eUUOY1aUz2lKu9Qy8cAu7Ns0Ia0nwScCpWt+iINN72qzLNlysSMHPZ HbigEFit0wGvmg4NAFnlMahOoP9kQHznMu1Uw+CxAkDpzG7USi52qURiELJVUvWXKaw6 TmWNvH8U3HxIUncAefi8jsG/qH5HVn42fgsiQHWhp14oeA2SUKpRw6FDAVzOR+O+198p 1FmpR15yQRnt5r88mNWzoN2QoZIGWkTRhluetms+g0M5kMXSBswjJ7BBigRb5MdjwehW Ksbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=hQqCTjoRIjLqoLUmPlZgKJ2ZaiAFSXArnm21e+xMC34=; b=rmwJF2wWRlpFhv0vIT6/hUC2YyVUhuWivL79XgsLLOxB+7x69IOfIT0N7H/DKfbpZd glXnB0GZvqbJyzqaP+zp/Dm4s0BpJk/HizcgQxDttDR+EqqXCwawX/aRqqSc6OTlONiA PZZa6mVWk0giTmn5VK/SV1qa+jL/+eqpHQc+8i/3hArGIeh+5YBU2Q37l5kMY0KCvxe+ bNJLlY/lI2VgCEcjv/OgSRd3BpvpXZBBmVeE1qc72t62VPaKi3iCNaS3kPCBQ0RvluLO KWvXwHy/tSk7jKDwVpaW6EvJh9g01QIo4Pj+oUSVCothVPQJbsHP9GSOOsusVVsytHfU mQUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mlAhdcX5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u64si11564043pgu.534.2018.12.11.03.04.09; Tue, 11 Dec 2018 03:04:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mlAhdcX5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726537AbeLKLDt (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:49 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36645 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbeLKLBl (ORCPT ); Tue, 11 Dec 2018 06:01:41 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5q017210; Tue, 11 Dec 2018 20:01:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5q017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526083; bh=hQqCTjoRIjLqoLUmPlZgKJ2ZaiAFSXArnm21e+xMC34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlAhdcX5/vK0XuWn+Ja+5hV04zdTzvpvxDr7o4JTTLWF6dgPcx02hC9pr9oDYMUfz oCkF+BlAz4JPKJEYFLPYOlI2/PhTl4pqcA2Q5en90tdWBmwmO82aM1EMncNvC/1OOc irMHgTqaEuEpX+cOU0goJBTQqTwroIAMg+/lcMLBT0y/CFcvMwYtCeToEv0FW7LUsz 80/UnAmnGz5jFBuuow9Iktz9WgwRNaxm34klyOK66kpchyGJRJgLDpnM2IZw7haIsH lN4lXnc1jJjchlQF3qQlPm5tNG0b9DmAMAi/m9kBC2DS9BT7E+qy0a67ISmZcUclR+ j0bfQpU4i6DLw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 15/27] kconfig: remove redundant token defines Date: Tue, 11 Dec 2018 20:00:58 +0900 Message-Id: <1544526070-16690-16-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These are already defined as %left. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 5 ----- 1 file changed, 5 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 7a4bc58..020454b 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -69,11 +69,6 @@ static struct menu *current_menu, *current_entry; %token T_ON %token T_WORD %token T_WORD_QUOTE -%token T_UNEQUAL -%token T_LESS -%token T_LESS_EQUAL -%token T_GREATER -%token T_GREATER_EQUAL %token T_CLOSE_PAREN %token T_OPEN_PAREN %token T_EOL From patchwork Tue Dec 11 11:00:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153433 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476024ljp; Tue, 11 Dec 2018 03:03:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/WpLoW0kkzU1aq/ixYMIawvpYeojw8p2dKb9Gw8Z9taKIPeJeh+XRUSWvVqmuwTrB/r/ka1 X-Received: by 2002:a62:6385:: with SMTP id x127mr16094285pfb.15.1544526181164; Tue, 11 Dec 2018 03:03:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526181; cv=none; d=google.com; s=arc-20160816; b=O4O8k4abqaYE3VuwoOKRaUYt+e3tx/VVFuoz6OPGYOY4L8aIo18gKsUnftnAErPrkZ SMi9VcQkmr654nJSbN77EsFXs9S/opSlR5Nno01jSdfudV7l17J1KhO99cYVGLzBtb1J RLCChykxwd+KGDi16yrIDJOPMS+btOJJS30tk9hF7ozqtcjM3AQLEae0wAovsaY80xdc M6XRhYBkuEl3wgCmtgwWz9fGN+b36j7Zx6zObGXN+AU5bEU/ib7E3CDghED0tMtIou4o ke3uT/wHIk7nJbDbbQGNvMGZzQsarHdghAiwa2pe4vki81gb4/tJTKzmqG32rlR//1G+ 8psA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=20fylg0O/NbaIrzaAWFHS70OGtASBygIuGQ2RPgwQQs=; b=BcH25pHUsiP128/z6sIIGehQL3EppsCWQlLROxKxISqwAJauKjLSENZi+gECYqIDVf 8P6ae0m7TKhDz3xSU/l9K+CVBlp04H3yntDayefCw6F4e7sxxIpgUVXO7PocXOfKtcI1 PjYHjD8gKExPfqWBxpJKINQyUISLZzKOtfOjpt+HIDgM3TSIgm24LJujzzITsH7qBtDj 6w+wRZer+MEDkuqJOfFu4VAauFdKaKTrd0tXVAmPOQECvkCMTAAhVL39fK6TFBef1a4O I+OJzOcAnxCZpV250eSSRahMARV2oRjn9rzTxOKz5S8qt4fNMAl+6hefExLZ2WmQXz53 883w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aViQDLRi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si12237529pgq.378.2018.12.11.03.03.00; Tue, 11 Dec 2018 03:03:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aViQDLRi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726830AbeLKLCq (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:46 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36708 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726609AbeLKLBn (ORCPT ); Tue, 11 Dec 2018 06:01:43 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5r017210; Tue, 11 Dec 2018 20:01:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5r017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526084; bh=20fylg0O/NbaIrzaAWFHS70OGtASBygIuGQ2RPgwQQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aViQDLRiEZDJZoPtq/blfU5vVvDgGIvjfpif58ddE/Jry0GNDipjMsFhtOIAmX/f+ /ybSk0cIbi5vZhbeg7D+yEFjFX9H23DYas7uyYxmjL10MxdgzZXJ6NKUlWH3+8KNM+ xEPNtcfohm3JcjGvON/t0e4gFMenNr4pT3kZbMOqWpLEzPFgB/vdaE70Jdl5mv7ukC s5OZlTeYMhkW2SzFTNcT/7uInfCo5iz0pUOiMIF6gVt3+a4ajNaomLNI+Q0LFX28vq BaAv6MBVgF8HYLQCydM0ERkkspJ750ta22EdelIriVQO2DC6dl8jpuSaKaJ8aPEWBM E3hOqzcEQjj6Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 16/27] kconfig: use distinct tokens for type and default properties Date: Tue, 11 Dec 2018 20:00:59 +0900 Message-Id: <1544526070-16690-17-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This commit removes kconf_id::stype to prepare for the entire removal of kconf_id.c To simplify the lexer, I want keywords straight-mapped to tokens. Signed-off-by: Masahiro Yamada --- scripts/kconfig/kconf_id.c | 16 ++++++------ scripts/kconfig/lkc.h | 1 - scripts/kconfig/zconf.y | 62 +++++++++++++++++++++++++++++----------------- 3 files changed, 47 insertions(+), 32 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/kconf_id.c b/scripts/kconfig/kconf_id.c index b3e0ea0..ec2c011 100644 --- a/scripts/kconfig/kconf_id.c +++ b/scripts/kconfig/kconf_id.c @@ -15,15 +15,15 @@ static struct kconf_id kconf_id_array[] = { { "endif", T_ENDIF, TF_COMMAND }, { "depends", T_DEPENDS, TF_COMMAND }, { "optional", T_OPTIONAL, TF_COMMAND }, - { "default", T_DEFAULT, TF_COMMAND, S_UNKNOWN }, + { "default", T_DEFAULT, TF_COMMAND }, + { "def_bool", T_DEF_BOOL, TF_COMMAND }, + { "def_tristate", T_DEF_TRISTATE, TF_COMMAND }, { "prompt", T_PROMPT, TF_COMMAND }, - { "tristate", T_TYPE, TF_COMMAND, S_TRISTATE }, - { "def_tristate", T_DEFAULT, TF_COMMAND, S_TRISTATE }, - { "bool", T_TYPE, TF_COMMAND, S_BOOLEAN }, - { "def_bool", T_DEFAULT, TF_COMMAND, S_BOOLEAN }, - { "int", T_TYPE, TF_COMMAND, S_INT }, - { "hex", T_TYPE, TF_COMMAND, S_HEX }, - { "string", T_TYPE, TF_COMMAND, S_STRING }, + { "bool", T_BOOL, TF_COMMAND }, + { "tristate", T_TRISTATE, TF_COMMAND }, + { "int", T_INT, TF_COMMAND }, + { "hex", T_HEX, TF_COMMAND }, + { "string", T_STRING, TF_COMMAND }, { "select", T_SELECT, TF_COMMAND }, { "imply", T_IMPLY, TF_COMMAND }, { "range", T_RANGE, TF_COMMAND }, diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 9eb7c83..b6bbcd1 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -50,7 +50,6 @@ struct kconf_id { const char *name; int token; unsigned int flags; - enum symbol_type stype; }; extern int yylineno; diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 020454b..4345f9f 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -40,6 +40,7 @@ static struct menu *current_menu, *current_entry; struct expr *expr; struct menu *menu; const struct kconf_id *id; + enum symbol_type type; enum variable_flavor flavor; } @@ -59,8 +60,6 @@ static struct menu *current_menu, *current_entry; %token T_DEPENDS %token T_OPTIONAL %token T_PROMPT -%token T_TYPE -%token T_DEFAULT %token T_SELECT %token T_IMPLY %token T_RANGE @@ -69,8 +68,16 @@ static struct menu *current_menu, *current_entry; %token T_ON %token T_WORD %token T_WORD_QUOTE +%token T_BOOL %token T_CLOSE_PAREN +%token T_DEFAULT +%token T_DEF_BOOL +%token T_DEF_TRISTATE +%token T_HEX +%token T_INT %token T_OPEN_PAREN +%token T_STRING +%token T_TRISTATE %token T_EOL %token T_VARIABLE %token T_ASSIGN @@ -85,6 +92,7 @@ static struct menu *current_menu, *current_entry; %type prompt %type nonconst_symbol %type symbol +%type type bool_or_tri default %type expr %type if_expr %type end @@ -169,12 +177,12 @@ config_option_list: | config_option_list help ; -config_option: T_TYPE prompt_stmt_opt T_EOL +config_option: type prompt_stmt_opt T_EOL { - menu_set_type($1->stype); + menu_set_type($1); printd(DEBUG_PARSE, "%s:%d:type(%u)\n", zconf_curname(), zconf_lineno(), - $1->stype); + $1); }; config_option: T_PROMPT prompt if_expr T_EOL @@ -183,14 +191,14 @@ config_option: T_PROMPT prompt if_expr T_EOL printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); }; -config_option: T_DEFAULT expr if_expr T_EOL +config_option: default expr if_expr T_EOL { menu_add_expr(P_DEFAULT, $2, $3); - if ($1->stype != S_UNKNOWN) - menu_set_type($1->stype); + if ($1 != S_UNKNOWN) + menu_set_type($1); printd(DEBUG_PARSE, "%s:%d:default(%u)\n", zconf_curname(), zconf_lineno(), - $1->stype); + $1); }; config_option: T_SELECT nonconst_symbol if_expr T_EOL @@ -274,15 +282,11 @@ choice_option: T_PROMPT prompt if_expr T_EOL printd(DEBUG_PARSE, "%s:%d:prompt\n", zconf_curname(), zconf_lineno()); }; -choice_option: T_TYPE prompt_stmt_opt T_EOL +choice_option: bool_or_tri prompt_stmt_opt T_EOL { - if ($1->stype == S_BOOLEAN || $1->stype == S_TRISTATE) { - menu_set_type($1->stype); - printd(DEBUG_PARSE, "%s:%d:type(%u)\n", - zconf_curname(), zconf_lineno(), - $1->stype); - } else - YYERROR; + menu_set_type($1); + printd(DEBUG_PARSE, "%s:%d:type(%u)\n", + zconf_curname(), zconf_lineno(), $1); }; choice_option: T_OPTIONAL T_EOL @@ -293,14 +297,26 @@ choice_option: T_OPTIONAL T_EOL choice_option: T_DEFAULT nonconst_symbol if_expr T_EOL { - if ($1->stype == S_UNKNOWN) { - menu_add_symbol(P_DEFAULT, $2, $3); - printd(DEBUG_PARSE, "%s:%d:default\n", - zconf_curname(), zconf_lineno()); - } else - YYERROR; + menu_add_symbol(P_DEFAULT, $2, $3); + printd(DEBUG_PARSE, "%s:%d:default\n", + zconf_curname(), zconf_lineno()); }; +type: + bool_or_tri + | T_INT { $$ = S_INT; } + | T_HEX { $$ = S_HEX; } + | T_STRING { $$ = S_STRING; } + +bool_or_tri: + T_BOOL { $$ = S_BOOLEAN; } + | T_TRISTATE { $$ = S_TRISTATE; } + +default: + T_DEFAULT { $$ = S_UNKNOWN; } + | T_DEF_BOOL { $$ = S_BOOLEAN; } + | T_DEF_TRISTATE { $$ = S_TRISTATE; } + choice_block: /* empty */ | choice_block common_stmt From patchwork Tue Dec 11 11:01:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153432 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475930ljp; Tue, 11 Dec 2018 03:02:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/Vj9qj1GupXDIhZxd0auo+kpWOwPISBk0dqRA1AF3uC7KL5Yt/lHQiZg/2kRCPaLYCf4G4V X-Received: by 2002:a17:902:708b:: with SMTP id z11mr15630423plk.203.1544526176886; Tue, 11 Dec 2018 03:02:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526176; cv=none; d=google.com; s=arc-20160816; b=AMUlLQ2Rhr+SPGQlpCDCxrJW3dpKfsIoaOZwD4Vmn3QWRyMDPO4BTKjG322uI9Y6pA Zqg15BA4C3lYuaPBKjqZVZcRkhpMuMJW8dUIcNCxGv8iR0mrReyPGHU0qWusVo1WUxAs N8ymBICRvlrx4JIi5XQic9fUqkM0ButPL+3Zwv4wqmoWb2e0z+3DWiHUfP/5vvXevh3O WuSWjq8l9td3YK3DouZkDdDZd/Jwhoxx2f4OtuyOaKR//Q7SmLjnInTc4oZrtnPk9vIA CFZxumlrbn6EN7c2En/ewlmVOfye3nFdOvGo3Z/y+f3UmRGIq54LifKPxSXB9bqPOjN1 KHEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=J02b+9Zj+B1p1FUXXgB3BFEcLl7iHu0uQ5OSwehpRuc=; b=kWSYA6zLB5CwXdJhgEb6w/BmnTE4iGh77NmbhbRvuZuF4PwZspMgqXKTEAHNhc5afE Cwa3OAzhCCwHKsKe9X1ZV5KnPRFVlMyfeRAYnAEG3hIMTz9i+j6uIOJHTQQ+Il1a3j6o 9gkgZAMBnCg6VuS4XK45/g5Nb0fyHrEUV0WBFWeH7RE2sfb0WmgVQt6iR2C5NbuRXZiN uFOCmeXHFChIxYL0vG8DTfpkX2rCDGoZZdTdE4HA6Tpk3Hmss2ISuSxJm4g7u9Xnhh5E 2+H4F6/PgCi4XjC9vGq6X2amA7q6ibzn1y/t+It3MMZNGhGm9fNyoJDOZHK7k1FU+dI/ cdPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Z00SIdjL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si12237529pgq.378.2018.12.11.03.02.56; Tue, 11 Dec 2018 03:02:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Z00SIdjL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbeLKLCs (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:48 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36717 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726620AbeLKLBn (ORCPT ); Tue, 11 Dec 2018 06:01:43 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5s017210; Tue, 11 Dec 2018 20:01:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5s017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526085; bh=J02b+9Zj+B1p1FUXXgB3BFEcLl7iHu0uQ5OSwehpRuc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z00SIdjLHCEj9f4UhYHhbGrQmDkm8Ucwpxly4GjBjq4vC3dq8njmE/cmA3R8waCe5 /tDKdNcOXLnotWWu3gHsWT4KIkbbSmuxB4J9UF7wILHZqb/OA+iwhjpqXEL/0t4ydJ lPyiHHtyxkc7RaW3lIYPlVtY+9yiuKLDxtLASzZ6ESFo2eMkQU2Nf8UVPLCjWAkn6t o9flduHBCJzSjsGP6xqSUFNJoJvCKgxgyfO8MvsHnlpQ6rSmlGgue7PP8TytQCXbGI ab7umbfKBcA/mY2hTKkv30TADvuKIHc3jQT+/IM8kVVRQVBH8xyH96CKQenP5czmgj rrSeTLOlOBX9A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 17/27] kconfig: refactor scanning and parsing "option" properties Date: Tue, 11 Dec 2018 20:01:00 +0900 Message-Id: <1544526070-16690-18-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For the keywords "modules", "defconfig_list", and "allnoconfig_y", the lexer should pass specific tokens instead of generic T_WORD. This simplifies both the lexer and the parser. Signed-off-by: Masahiro Yamada --- scripts/kconfig/kconf_id.c | 3 --- scripts/kconfig/lkc.h | 9 +++------ scripts/kconfig/menu.c | 43 ++++++++++++++++++++----------------------- scripts/kconfig/zconf.l | 3 +++ scripts/kconfig/zconf.y | 35 +++++++++++++++-------------------- 5 files changed, 41 insertions(+), 52 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/kconf_id.c b/scripts/kconfig/kconf_id.c index ec2c011..f8b222c 100644 --- a/scripts/kconfig/kconf_id.c +++ b/scripts/kconfig/kconf_id.c @@ -30,9 +30,6 @@ static struct kconf_id kconf_id_array[] = { { "visible", T_VISIBLE, TF_COMMAND }, { "option", T_OPTION, TF_COMMAND }, { "on", T_ON, TF_PARAM }, - { "modules", T_OPT_MODULES, TF_OPTION }, - { "defconfig_list", T_OPT_DEFCONFIG_LIST, TF_OPTION }, - { "allnoconfig_y", T_OPT_ALLNOCONFIG_Y, TF_OPTION }, }; #define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id)) diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index b6bbcd1..5f4880a 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -32,7 +32,6 @@ static inline const char *CONFIG_prefix(void) #define TF_COMMAND 0x0001 #define TF_PARAM 0x0002 -#define TF_OPTION 0x0004 enum conf_def_mode { def_default, @@ -42,10 +41,6 @@ enum conf_def_mode { def_random }; -#define T_OPT_MODULES 1 -#define T_OPT_DEFCONFIG_LIST 2 -#define T_OPT_ALLNOCONFIG_Y 4 - struct kconf_id { const char *name; int token; @@ -90,7 +85,9 @@ void menu_add_visibility(struct expr *dep); struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep); -void menu_add_option(int token, char *arg); +void menu_add_option_modules(void); +void menu_add_option_defconfig_list(void); +void menu_add_option_allnoconfig_y(void); void menu_finalize(struct menu *parent); void menu_set_type(int type); diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 4cf15d4..7e2b2c9 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -195,29 +195,26 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); } -void menu_add_option(int token, char *arg) -{ - switch (token) { - case T_OPT_MODULES: - if (modules_sym) - zconf_error("symbol '%s' redefines option 'modules'" - " already defined by symbol '%s'", - current_entry->sym->name, - modules_sym->name - ); - modules_sym = current_entry->sym; - break; - case T_OPT_DEFCONFIG_LIST: - if (!sym_defconfig_list) - sym_defconfig_list = current_entry->sym; - else if (sym_defconfig_list != current_entry->sym) - zconf_error("trying to redefine defconfig symbol"); - sym_defconfig_list->flags |= SYMBOL_NO_WRITE; - break; - case T_OPT_ALLNOCONFIG_Y: - current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; - break; - } +void menu_add_option_modules(void) +{ + if (modules_sym) + zconf_error("symbol '%s' redefines option 'modules' already defined by symbol '%s'", + current_entry->sym->name, modules_sym->name); + modules_sym = current_entry->sym; +} + +void menu_add_option_defconfig_list(void) +{ + if (!sym_defconfig_list) + sym_defconfig_list = current_entry->sym; + else if (sym_defconfig_list != current_entry->sym) + zconf_error("trying to redefine defconfig symbol"); + sym_defconfig_list->flags |= SYMBOL_NO_WRITE; +} + +void menu_add_option_allnoconfig_y(void) +{ + current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; } static int menu_validate_number(struct symbol *sym, struct symbol *sym2) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 5046d3c..0265502 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -147,6 +147,9 @@ n [A-Za-z0-9_-] } { + "modules" return T_MODULES; + "defconfig_list" return T_DEFCONFIG_LIST; + "allnoconfig_y" return T_ALLNOCONFIG_Y; "&&" return T_AND; "||" return T_OR; "(" return T_OPEN_PAREN; diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 4345f9f..8db9189 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -64,18 +64,21 @@ static struct menu *current_menu, *current_entry; %token T_IMPLY %token T_RANGE %token T_VISIBLE -%token T_OPTION %token T_ON %token T_WORD %token T_WORD_QUOTE +%token T_ALLNOCONFIG_Y %token T_BOOL %token T_CLOSE_PAREN %token T_DEFAULT +%token T_DEFCONFIG_LIST %token T_DEF_BOOL %token T_DEF_TRISTATE %token T_HEX %token T_INT +%token T_MODULES %token T_OPEN_PAREN +%token T_OPTION %token T_STRING %token T_TRISTATE %token T_EOL @@ -97,7 +100,7 @@ static struct menu *current_menu, *current_entry; %type if_expr %type end %type if_entry menu_entry choice_entry -%type symbol_option_arg word_opt assign_val +%type word_opt assign_val %destructor { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -172,7 +175,6 @@ menuconfig_stmt: menuconfig_entry_start config_option_list config_option_list: /* empty */ | config_option_list config_option - | config_option_list symbol_option | config_option_list depends | config_option_list help ; @@ -219,27 +221,20 @@ config_option: T_RANGE symbol symbol if_expr T_EOL printd(DEBUG_PARSE, "%s:%d:range\n", zconf_curname(), zconf_lineno()); }; -symbol_option: T_OPTION symbol_option_list T_EOL -; +config_option: T_OPTION T_MODULES T_EOL +{ + menu_add_option_modules(); +}; -symbol_option_list: - /* empty */ - | symbol_option_list T_WORD symbol_option_arg +config_option: T_OPTION T_DEFCONFIG_LIST T_EOL { - const struct kconf_id *id = kconf_id_lookup($2, strlen($2)); - if (id && id->flags & TF_OPTION) { - menu_add_option(id->token, $3); - free($3); - } - else - zconfprint("warning: ignoring unknown option %s", $2); - free($2); + menu_add_option_defconfig_list(); }; -symbol_option_arg: - /* empty */ { $$ = NULL; } - | T_EQUAL prompt { $$ = $2; } -; +config_option: T_OPTION T_ALLNOCONFIG_Y T_EOL +{ + menu_add_option_allnoconfig_y(); +}; /* choice entry */ From patchwork Tue Dec 11 11:01:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153436 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476304ljp; Tue, 11 Dec 2018 03:03:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/VNdY2qaCtHraq+kw0w144YK6CvbDdnztrrQtbpxw4nP5IzIxvhMfC3pk9IoPgaJ5Tbg015 X-Received: by 2002:a63:c42:: with SMTP id 2mr14235524pgm.372.1544526196425; Tue, 11 Dec 2018 03:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526196; cv=none; d=google.com; s=arc-20160816; b=t7z08v3lPOH/0XhBFeDlevsmTm3MYTSFGIU0+Thfao7AoSqpMdvEPmxEr7bUx60Jfz Sd0II/7XHvt6dBvHjQftYGNxlr43Ru6ZWts/VJcU/+Bqmii8v+MRqJtVVO9DdfsZ/tmf VADxcYgG5Hs7iHTQ9XJFNJxmPOAmGUEWSALdGH+oylDvI8p57jGCgQOIvrIdMSUyBO7r /V9CYlvHpRHScO7smz6mj1T5IvsAmGLoLs5BbvuNKvWVJxr9pwKZsNW0qc3Jki2CHtra ZuBStoZxDIw8iLRYdFyYzKVTlLE4cDuCynF5zL9m9e16JP0VYDa5CxGu84B/MSpIc124 SVTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=w/qYlVHaXWWOa9cxgI46RT+MZV4dG4xlFL58RSeeBfA=; b=JyLMsh6buwycf97VteQAUYew0zv1LnKGrk5HdsbrlRB/ek51UEBXqLdY7NedLNm3pF wo3puot0ouGlkmMlobBYeQ96aqvyq0cNauKdr3db1c7phe7e0/z9uflcbJoMW93LW1tE ZOhiFGY41WcAHLcUNYdduLaUtYp/9AFTJmuGOQTc7zzW6rcFxIuQUzW9cIxQR59tJoNa xa5uS4TuiZErMvg5Ld7xoRwYy+cVYixQYfX/qNLUatL6eXAIVxoW6EDm9F5196gUzkxW vReTlYMuN8ZqwC/qIBl0CLly/uVsNUTxHrvR6ufLA/oII2pt9WQUQskdvEnieyns1BX6 4fnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=AOvmGtDG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si11652776pgk.101.2018.12.11.03.03.16; Tue, 11 Dec 2018 03:03:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=AOvmGtDG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726274AbeLKLDN (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:13 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36704 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726588AbeLKLBn (ORCPT ); Tue, 11 Dec 2018 06:01:43 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5t017210; Tue, 11 Dec 2018 20:01:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5t017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526085; bh=w/qYlVHaXWWOa9cxgI46RT+MZV4dG4xlFL58RSeeBfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AOvmGtDGss4NmM5N9cdOCLCqVoW5tbiBQAk95isqDaBaxmdJzU/dOWTpZAeDKHOr7 9EZCwu6vK88iJVjI2Ou0NzN/771Lo0mUvDET6Zf8ch7r1fFt7WdF2VkbZXDcTDFx6m GELp4kONZXTHIO/AlX2FO07CHMlI1GBaBYEzLiBr4S97vd6w8IUK2ENNtWhhO3/N3G AvL0rMsWh4R+dZokNWu3UER3zZIpDDmWMmXEKkbyZ/6ge/edMzSwIcVsYB2nX7yWVy arhyOXSHeGG8PsIyw3md1jS42FyTnbZtiBtCZLDjSkPu2g19KjOSqey8X802PHKcLC FpfjWq+mmQ24A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 18/27] kconfig: use specific tokens instead of T_ASSIGN for assignments Date: Tue, 11 Dec 2018 20:01:01 +0900 Message-Id: <1544526070-16690-19-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the lexer returns T_ASSIGN for all of =, :=, and += associating yylval with the flavor. I want to make the generated lexer as simple as possible. So, the lexer should convert keywords to tokens without thinking about the meaning. = -> T_EQUAL := -> T_COLON_EQUAL += -> T_PLUS_EQUAL Unfortunately, Kconfig uses = instead of == for the equal operator. So, both assignment and comparison use T_EQUAL. The parser can still distinguish them from the context. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 6 +++--- scripts/kconfig/zconf.y | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 0265502..981b5f8 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -125,9 +125,9 @@ n [A-Za-z0-9_-] 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; } + "=" { BEGIN(ASSIGN_VAL); return T_EQUAL; } + ":=" { BEGIN(ASSIGN_VAL); return T_COLON_EQUAL; } + "+=" { BEGIN(ASSIGN_VAL); return T_PLUS_EQUAL; } [[:blank:]]+ . warn_ignored_character(*yytext); \n { diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 8db9189..97f86e2 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -70,6 +70,7 @@ static struct menu *current_menu, *current_entry; %token T_ALLNOCONFIG_Y %token T_BOOL %token T_CLOSE_PAREN +%token T_COLON_EQUAL %token T_DEFAULT %token T_DEFCONFIG_LIST %token T_DEF_BOOL @@ -79,11 +80,11 @@ static struct menu *current_menu, *current_entry; %token T_MODULES %token T_OPEN_PAREN %token T_OPTION +%token T_PLUS_EQUAL %token T_STRING %token T_TRISTATE %token T_EOL %token T_VARIABLE -%token T_ASSIGN %token T_ASSIGN_VAL %left T_OR @@ -101,6 +102,7 @@ static struct menu *current_menu, *current_entry; %type end %type if_entry menu_entry choice_entry %type word_opt assign_val +%type assign_op %destructor { fprintf(stderr, "%s:%d: missing end statement for this entry\n", @@ -478,7 +480,13 @@ word_opt: /* empty */ { $$ = NULL; } /* assignment statement */ -assignment_stmt: T_VARIABLE T_ASSIGN assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } +assignment_stmt: T_VARIABLE assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } + +assign_op: + T_EQUAL { $$ = VAR_RECURSIVE; } + | T_COLON_EQUAL { $$ = VAR_SIMPLE; } + | T_PLUS_EQUAL { $$ = VAR_APPEND; } +; assign_val: /* empty */ { $$ = xstrdup(""); }; From patchwork Tue Dec 11 11:01:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153424 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp474953ljp; Tue, 11 Dec 2018 03:02:04 -0800 (PST) X-Google-Smtp-Source: AFSGD/UXuEs23vpygo6/1TCP6KITkpFg15jqUcmIWli1xB6UMRp+n6YhnuXk1NEqjPu9eeHwEMxz X-Received: by 2002:a63:554b:: with SMTP id f11mr14524794pgm.37.1544526124611; Tue, 11 Dec 2018 03:02:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526124; cv=none; d=google.com; s=arc-20160816; b=PhbnbLSNOb3POGl5f/ZPnvJNM4F1fB668hC+5H/6y2OSP1gvYaPZynCrhrI3s3U236 Pkx314kBpyF5QAU65sw2DbKne1qBa2I2vg2HmmGM9fG1Gkrtsjq/STY0ROHyI6HdYrhc HuwkEFNiPiW9fLxop6f9xGInSVZyDxxiOWAeTfmaJbW1fJEaVF6JnTwAI7t4CX7GA2Sb FTrEP8U5NWdtsXzSfyNTfBIXvIS+71BYaKKhD3JVTtQvDnx74Vqg/8Iln/MLuqSd2VVA VbKoAQVjV653KjZUv/GY1n+4ep+LHUTMYFHErQqpzO5NqisnGRZQA9wRkc/gU8O/8dwY LwNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=uqOZ9vU8oru+M9Os9BjewQ7I6t7aJJ1laipYhaaZlRQ=; b=OScoqkC4mTlYeWw2NsP5OgWcqECn28V6tTxuSAToafXWcthmin0CGiq9ZI5NbqF8c+ 2uHmQVeae7nFMDFOdkoJ5m0YSiFQdyxEJczDL1eXlhptHjcyLDHB0aabZp2N8qqEXVEp xc1bKXtxh43kGCp65khgBEi/sWZtYcsOfZCnMCrdsVzXWtWOetryTvb/R19PzwsfrkPZ XqzxX8acmj6G/7INRXZD93MTeFjjBzMD17GVd1+c8rYmxAWOwo5CaQWLu7G+GsJJicwQ n/kZ4S1SiD/qvP11PTmsX1OZxKQ5oLu732KDPA4qzirs2jJTAt4K47Kf/dpIevbQdD5b Y31A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FGgwOUfp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si12526290pla.81.2018.12.11.03.02.04; Tue, 11 Dec 2018 03:02:04 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FGgwOUfp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbeLKLBv (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:51 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36706 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726600AbeLKLBo (ORCPT ); Tue, 11 Dec 2018 06:01:44 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5u017210; Tue, 11 Dec 2018 20:01:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5u017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526086; bh=uqOZ9vU8oru+M9Os9BjewQ7I6t7aJJ1laipYhaaZlRQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGgwOUfpfex79hXVFIznqJ03YWykn1b5Ie9Yi7W13S0/MfuZ1/YHOzE/Wbxe+HDzM 9Ep+/KcvTASYBlSVrBC8ckfZ4v+uMExEEDPvsbXMPJ53WTzdz0YRTanuw/G5uSnW7z sqIwAPsAtm/FM6cfiVDhTiqG7i4wLujFQqWP52UTw5+tXT3jjxqDlZ3eW+DEkfv3iN 8gDRC/GMz2uOf/epdif4n72wXaub6rL5YnXHuuDPWhYWxuoFTzORk+6ZpFv+UNu9jv eqcbEtq9LdTVUI6ak537rINB8ySXaI7QGjQW2U4tfPyU0wcrlKu0LR1pUsNHWeSXck r7fYiUownkBAA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 19/27] kconfig: use T_WORD instead of T_VARIABLE for variables Date: Tue, 11 Dec 2018 20:01:02 +0900 Message-Id: <1544526070-16690-20-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no grammatical ambiguity by using T_WORD for variables. The parser can distinguish variables from symbols from the context. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 4 ++-- scripts/kconfig/zconf.y | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index 981b5f8..defb722 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -116,13 +116,13 @@ n [A-Za-z0-9_-] } alloc_string(yytext, yyleng); yylval.string = text; - return T_VARIABLE; + return T_WORD; } ({n}|$)+ { /* this token includes at least one '$' */ yylval.string = expand_token(yytext, yyleng); if (strlen(yylval.string)) - return T_VARIABLE; + return T_WORD; free(yylval.string); } "=" { BEGIN(ASSIGN_VAL); return T_EQUAL; } diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 97f86e2..3c44d67 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -84,7 +84,6 @@ static struct menu *current_menu, *current_entry; %token T_STRING %token T_TRISTATE %token T_EOL -%token T_VARIABLE %token T_ASSIGN_VAL %left T_OR @@ -480,7 +479,7 @@ word_opt: /* empty */ { $$ = NULL; } /* assignment statement */ -assignment_stmt: T_VARIABLE assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } +assignment_stmt: T_WORD assign_op assign_val T_EOL { variable_add($1, $3, $2); free($1); free($3); } assign_op: T_EQUAL { $$ = VAR_RECURSIVE; } From patchwork Tue Dec 11 11:01:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153422 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp474810ljp; Tue, 11 Dec 2018 03:01:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/XX+IHwgg1P5t0lp9VSjxE2MPEZQI+UOkItBhgORh488cCK9vse4uYAevM1ikZ9cx9/p3ld X-Received: by 2002:a62:f907:: with SMTP id o7mr15569084pfh.244.1544526116769; Tue, 11 Dec 2018 03:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526116; cv=none; d=google.com; s=arc-20160816; b=XGB1WLWoc+5a3b6xr3Usy5ufrMLHbvGsFN1Zm8ObiDTPFgaG/pSUBsSZjybKPxia7C qjpL7DnGYUlEBUgp4+DuLAYZLdu7rREdjJ272pWj9DiZ87m9y4sAeCJnLJYl/Z2O+cll 6PHlBI/zYqH+Ku+Bb6MpVbbeNhJ/pi4/p7h/JdCn6fcCHua8OUEDDmSF3u2EA9UF6Zb+ UO41Ohv1/MmOHxSYCQAiufogQVUpCujCkSyz+iMugNg/cNHxP0g0YWIcfNWiNZyITgr7 AUIkI3G3N+LYPhwQ+8IA5d1SJj7OASsDqsnpWex6mC1EjY985yV63Q1xxkIBx3ds2Xfx Jfrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=E5748NZyl+90o6KcOmeB0jqh57but7eKhlAPYZZaCdo=; b=p/r4AWgwBIgEa/MYQ95hvXw3mNMH9Gh6CJ/Pfld+AmNhplv68qC4HOe0EF7ch8TzlV 7AKxp/sMp/X2Q0OhQOvideF0iHADD2irkq1Odv0QQkLgQ8jTbW1askDbO4skl46ZfHVf ZpRGtZasDuB7dAMWoK9suFgf2AOn879RQRUOGpcnm0dxroiKhUdi9x6dCIdlR+ZpeFdR YRAWcempcldbNwVmetHr6lpN6S3pczsSN7yE2SXuGKrOlHoHqIrxpPOSL1UySLE0FEZH lfdaYc3nJku/TM4UlRlThsYNAVsdlybwc+xnQJ/6i2OGJl+tNhnMzVDMDhYcSr+MNoHd gvdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="X2MiZ7U/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v13si11975393pgn.355.2018.12.11.03.01.56; Tue, 11 Dec 2018 03:01:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="X2MiZ7U/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726769AbeLKLBy (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:54 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:37031 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726738AbeLKLBw (ORCPT ); Tue, 11 Dec 2018 06:01:52 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5v017210; Tue, 11 Dec 2018 20:01:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5v017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526087; bh=E5748NZyl+90o6KcOmeB0jqh57but7eKhlAPYZZaCdo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X2MiZ7U/GH8sihqbUev6Ry1nqri4gmPO9sE5AOQgLqDdeH52B+VWCBKHQJadeE41P HsessXnJS06PRG+NX24cUvKR2k86w1yNrn2BIDwlLreE8mQoOT++c2L8FMQVfJHK6t IoHkPkJqsdVHRhKnEYN8q77pQ9SXZuVuK/fbPVEyVdje0sjFstfwsnIWby3yJWF+yG aCRmc3IJUVPq7Fu10CDx+d8cLxxB7+yvQPQqKJQ+vzYoyFO1X2YcdcU4SYh6EL+Czp JsMmxjL4vNT0+y3bd3Z3CQvcuE9jJ5LfPFKJAe6LPj9312CQ/wNc49BlxTnpW3FjPn 1PGFDu1yapPrw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada , Michal Simek Subject: [PATCH 20/27] microblaze: surround string default in Kconfig with double quotes Date: Tue, 11 Dec 2018 20:01:03 +0900 Message-Id: <1544526070-16690-21-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I guess this is a constant value instead of a symbol. Signed-off-by: Masahiro Yamada --- I will apply this to my Kbuild tree because it is necessary for Kconfig clean-ups. arch/microblaze/Kconfig.platform | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 Acked-by: Michal Simek diff --git a/arch/microblaze/Kconfig.platform b/arch/microblaze/Kconfig.platform index f7f1739..7361974 100644 --- a/arch/microblaze/Kconfig.platform +++ b/arch/microblaze/Kconfig.platform @@ -65,6 +65,6 @@ config XILINX_MICROBLAZE0_USE_FPU config XILINX_MICROBLAZE0_HW_VER string "Core version number" - default 7.10.d + default "7.10.d" endmenu From patchwork Tue Dec 11 11:01:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153440 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp476728ljp; Tue, 11 Dec 2018 03:03:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/V6g7w1NT1ufUaTAfAe1MgJDvyqB4JVHmc1TsVGUNnHREORFhFe12UUtnr4saSp8WRE7yvl X-Received: by 2002:a63:101:: with SMTP id 1mr14152345pgb.152.1544526221210; Tue, 11 Dec 2018 03:03:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526221; cv=none; d=google.com; s=arc-20160816; b=FNEgdv6XVX9uqA4B5OYzlEU1tUOP5KpowLAe630NGeKAmkWNesMjnlUQJAUtS2sI4r 95cx25BFfPkN4EMWxZJlq0pLbLQs/9fJp98bKjqroBuA4P6q9jLgpUAEM3X0u+8o9khD kYaLI9JtnWyazt4v+brCEN13HCAySD0e6DJIFpMvk8cjtMW4vJ5E/pyXymGVyD5T5mZz uBB/1GdSAIcqg/jbsQ9EmyYf+0gR/UJonY0wPMJXmxzP5fAe0jES42hIJomPrkrQ9pW+ 9yhwV1P/AmxgfMqs0jJXIP/XaClu/y605Hnw5XSRB4nhrSzuZtCqpGV2PW8G82/lZvIk y0oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=tBsTKFpBDaVZFtEdXeCgfra6ewSQbds4MCpGPn41bzg=; b=LQ2Um73AHfXKWhaAGP848eEJ3dJiIC7wnFQpqmt35Bs62knr/5IfNjpdymFUTMMj9j dQ7DQqnccYKv4HClZJ0QDJ9Ay66BItfrWxmeBbTYQfbzumyCwOnpX8CDxu0eeIPeBuj+ LW2y27zDotVCQcIdUC5lStfc2PXjBbPKSbSCbJTqzn8jIr5668HyGLv5I5FEN/LckITL Ri/WAXRCLiuFayeBKcC/5fGOTqEPUZd6E6X3IdXW+e7ZzutXtkMP0iYAr3q83mGIDyw0 UFlDPtrADS4BMEdEj0yLiVw25ZKP1Xin8h+60YjLFZScVXjo/Oqjy5ok94aVXxSYMf3E YFtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Im4WPkcw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si11931615pgg.433.2018.12.11.03.03.40; Tue, 11 Dec 2018 03:03:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Im4WPkcw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726507AbeLKLDh (ORCPT + 31 others); Tue, 11 Dec 2018 06:03:37 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:39670 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbeLKLDg (ORCPT ); Tue, 11 Dec 2018 06:03:36 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5w017210; Tue, 11 Dec 2018 20:01:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5w017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526088; bh=tBsTKFpBDaVZFtEdXeCgfra6ewSQbds4MCpGPn41bzg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Im4WPkcw6bjRHZnO1HdZfs9JFn7bo0znz55uqxmyDAp1Amh5xnS33DFM4CAZv3A3m P3U8FgMZmju99ammGCJR7SvI9Ix/oj8XRMclxpYwG1r+1UwKSlwayklXK9DQ5XMgwW tIuuXdVcyXNON8J6rtwl37lGnyklTLfZxPrNU3meqRspXV3Zmw/37gQstFSVypsarx k0wPVWAEze3aAekVozH/9MTxCpyXaZLTdQ0dkirIyagR+EG+WZNM687BHzAiExtPbM sNDoPTYItpjj2gyaC7vejFm7nhFSx2RkCEhIlBeAu5ucCELYQIxmv5EGTRwWEb2J5h rmeMbUPPD3zLQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-arch , "David S. Miller" , David Howells , Thomas Gleixner , Will Deacon , Wolfram Sang , Ingo Molnar , Geert Uytterhoeven , Herbert Xu , linux-arm-kernel@lists.infradead.org Subject: [PATCH 21/27] treewide: surround file paths in Kconfig files with double quotes Date: Tue, 11 Dec 2018 20:01:04 +0900 Message-Id: <1544526070-16690-22-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Kconfig lexer supports special characters such as '.' and '/' in the parameter context. In my understanding, the reason is just to support bare file paths in the source statement. I do not see a good reason to complicate Kconfig for the room of ambiguity. The majority of code already surround file paths with double quotes, and it makes sense since the included file paths are constant string literals. Make it treewide consistent now. Signed-off-by: Masahiro Yamada --- I will apply this to my Kbuild tree because it is necessary for Kconfig clean-ups. arch/arm/Kconfig | 2 +- arch/arm/kvm/Kconfig | 2 +- arch/arm64/Kconfig | 2 +- arch/arm64/kvm/Kconfig | 2 +- arch/ia64/Kconfig | 2 +- arch/m68k/Kconfig | 6 +++--- arch/mips/kvm/Kconfig | 2 +- arch/openrisc/Kconfig | 2 +- arch/powerpc/Kconfig | 4 ++-- arch/powerpc/kvm/Kconfig | 2 +- arch/riscv/Kconfig | 2 +- arch/s390/Kconfig | 2 +- arch/s390/kvm/Kconfig | 2 +- arch/sh/Kconfig | 2 +- arch/sparc/Kconfig | 2 +- arch/x86/Kconfig | 2 +- arch/x86/kvm/Kconfig | 2 +- block/Kconfig | 2 +- crypto/Kconfig | 4 ++-- drivers/crypto/Kconfig | 2 +- drivers/gpu/drm/i915/Kconfig | 2 +- drivers/hwmon/Kconfig | 2 +- drivers/i2c/Kconfig | 6 +++--- drivers/pps/Kconfig | 4 ++-- drivers/ras/Kconfig | 2 +- drivers/thermal/Kconfig | 2 +- drivers/w1/Kconfig | 4 ++-- lib/Kconfig.debug | 4 ++-- security/Kconfig | 16 ++++++++-------- security/integrity/Kconfig | 4 ++-- 30 files changed, 47 insertions(+), 47 deletions(-) -- 2.7.4 Acked-by: Wolfram Sang Acked-by: Geert Uytterhoeven Acked-by: Ingo Molnar diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 91be74d..0a7faf8 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -910,7 +910,7 @@ config PLAT_VERSATILE source "arch/arm/firmware/Kconfig" -source arch/arm/mm/Kconfig +source "arch/arm/mm/Kconfig" config IWMMXT bool "Enable iWMMXt support" diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index e2bd35b..3f5320f 100644 --- a/arch/arm/kvm/Kconfig +++ b/arch/arm/kvm/Kconfig @@ -55,6 +55,6 @@ config KVM_ARM_HOST ---help--- Provides host support for ARM processors. -source drivers/vhost/Kconfig +source "drivers/vhost/Kconfig" endif # VIRTUALIZATION diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ea2ab03..8a84de3 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -807,7 +807,7 @@ config NEED_PER_CPU_EMBED_FIRST_CHUNK config HOLES_IN_ZONE def_bool y -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index 47b23bf..a3f8562 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig @@ -61,6 +61,6 @@ config KVM_ARM_PMU config KVM_INDIRECT_VECTORS def_bool KVM && (HARDEN_BRANCH_PREDICTOR || HARDEN_EL2_VECTORS) -source drivers/vhost/Kconfig +source "drivers/vhost/Kconfig" endif # VIRTUALIZATION diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index 36773de..0ef105a 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig @@ -261,7 +261,7 @@ config HZ endif if !IA64_HP_SIM -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" endif config IA64_BRL_EMU diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 1bc9f1b..6f18c45 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig @@ -123,11 +123,11 @@ config BOOTINFO_PROC menu "Platform setup" -source arch/m68k/Kconfig.cpu +source "arch/m68k/Kconfig.cpu" -source arch/m68k/Kconfig.machine +source "arch/m68k/Kconfig.machine" -source arch/m68k/Kconfig.bus +source "arch/m68k/Kconfig.bus" endmenu diff --git a/arch/mips/kvm/Kconfig b/arch/mips/kvm/Kconfig index 76b93a9..c369302 100644 --- a/arch/mips/kvm/Kconfig +++ b/arch/mips/kvm/Kconfig @@ -72,6 +72,6 @@ config KVM_MIPS_DEBUG_COP0_COUNTERS If unsure, say N. -source drivers/vhost/Kconfig +source "drivers/vhost/Kconfig" endif # VIRTUALIZATION diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig index 285f7d0..d765b4a 100644 --- a/arch/openrisc/Kconfig +++ b/arch/openrisc/Kconfig @@ -139,7 +139,7 @@ config SMP If you don't know what to do here, say N. -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config OPENRISC_NO_SPR_SR_DSX bool "use SPR_SR_DSX software emulation" if OR1K_1200 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 8be3126..e1307d6 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -393,7 +393,7 @@ config HIGHMEM bool "High memory support" depends on PPC32 -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config HUGETLB_PAGE_SIZE_VARIABLE bool @@ -816,7 +816,7 @@ config ARCH_WANTS_FREEZER_CONTROL def_bool y depends on ADB_PMU -source kernel/power/Kconfig +source "kernel/power/Kconfig" config SECCOMP bool "Enable seccomp to safely compute untrusted bytecode" diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index 68a0e9d..bfdde04 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig @@ -204,6 +204,6 @@ config KVM_XIVE default y depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE -source drivers/vhost/Kconfig +source "drivers/vhost/Kconfig" endif # VIRTUALIZATION diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 55da93f..4f428ab 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -287,6 +287,6 @@ endmenu menu "Power management options" -source kernel/power/Kconfig +source "kernel/power/Kconfig" endmenu diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 5173366..48de9d3 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig @@ -520,7 +520,7 @@ config SCHED_TOPOLOGY making when dealing with machines that have multi-threading, multiple cores or multiple books. -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config KEXEC def_bool y diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig index a3dbd45..767453f 100644 --- a/arch/s390/kvm/Kconfig +++ b/arch/s390/kvm/Kconfig @@ -57,6 +57,6 @@ config KVM_S390_UCONTROL # OK, it's a little counter-intuitive to do this, but it puts it neatly under # the virtualization menu. -source drivers/vhost/Kconfig +source "drivers/vhost/Kconfig" endif # VIRTUALIZATION diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index f82a4da..b2581b1 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -597,7 +597,7 @@ endmenu menu "Kernel features" -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config KEXEC bool "kexec system call (EXPERIMENTAL)" diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 490b2c9..29b97f1 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -187,7 +187,7 @@ config NR_CPUS default 32 if SPARC32 default 4096 if SPARC64 -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config RWSEM_GENERIC_SPINLOCK bool diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8689e79..59433a52 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1965,7 +1965,7 @@ config SECCOMP If unsure, say Y. Only embedded should say N here. -source kernel/Kconfig.hz +source "kernel/Kconfig.hz" config KEXEC bool "kexec system call" diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 1bbec38..72fa955 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -98,6 +98,6 @@ config KVM_MMU_AUDIT # OK, it's a little counter-intuitive to do this, but it puts it neatly under # the virtualization menu. -source drivers/vhost/Kconfig +source "drivers/vhost/Kconfig" endif # VIRTUALIZATION diff --git a/block/Kconfig b/block/Kconfig index f7045aa..1b91498 100644 --- a/block/Kconfig +++ b/block/Kconfig @@ -224,4 +224,4 @@ config BLK_MQ_RDMA config BLK_PM def_bool BLOCK && PM -source block/Kconfig.iosched +source "block/Kconfig.iosched" diff --git a/crypto/Kconfig b/crypto/Kconfig index 05c91eb..d18b1c3 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -1826,7 +1826,7 @@ config CRYPTO_HASH_INFO bool source "drivers/crypto/Kconfig" -source crypto/asymmetric_keys/Kconfig -source certs/Kconfig +source "crypto/asymmetric_keys/Kconfig" +source "certs/Kconfig" endif # if CRYPTO diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index caa98a7f..4db49de 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -258,7 +258,7 @@ config CRYPTO_DEV_HIFN_795X_RNG Select this option if you want to enable the random number generator on the HIFN 795x crypto adapters. -source drivers/crypto/caam/Kconfig +source "drivers/crypto/caam/Kconfig" config CRYPTO_DEV_TALITOS tristate "Talitos Freescale Security Engine (SEC)" diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index 33a458b..148be8e 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -131,5 +131,5 @@ config DRM_I915_GVT_KVMGT menu "drm/i915 Debugging" depends on DRM_I915 depends on EXPERT -source drivers/gpu/drm/i915/Kconfig.debug +source "drivers/gpu/drm/i915/Kconfig.debug" endmenu diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 81da17a..9ccbbd3 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1306,7 +1306,7 @@ config SENSORS_PCF8591 These devices are hard to detect and rarely found on mainstream hardware. If unsure, say N. -source drivers/hwmon/pmbus/Kconfig +source "drivers/hwmon/pmbus/Kconfig" config SENSORS_PWM_FAN tristate "PWM fan" diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index efc3354..c6b7fc7 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig @@ -68,7 +68,7 @@ config I2C_MUX This support is also available as a module. If so, the module will be called i2c-mux. -source drivers/i2c/muxes/Kconfig +source "drivers/i2c/muxes/Kconfig" config I2C_HELPER_AUTO bool "Autoselect pertinent helper modules" @@ -94,8 +94,8 @@ config I2C_SMBUS This support is also available as a module. If so, the module will be called i2c-smbus. -source drivers/i2c/algos/Kconfig -source drivers/i2c/busses/Kconfig +source "drivers/i2c/algos/Kconfig" +source "drivers/i2c/busses/Kconfig" config I2C_STUB tristate "I2C/SMBus Test Stub" diff --git a/drivers/pps/Kconfig b/drivers/pps/Kconfig index c6008f2..965aa08 100644 --- a/drivers/pps/Kconfig +++ b/drivers/pps/Kconfig @@ -37,8 +37,8 @@ config NTP_PPS It doesn't work on tickless systems at the moment. -source drivers/pps/clients/Kconfig +source "drivers/pps/clients/Kconfig" -source drivers/pps/generators/Kconfig +source "drivers/pps/generators/Kconfig" endif # PPS diff --git a/drivers/ras/Kconfig b/drivers/ras/Kconfig index 4c3c67d..b834ff5 100644 --- a/drivers/ras/Kconfig +++ b/drivers/ras/Kconfig @@ -30,6 +30,6 @@ menuconfig RAS if RAS -source arch/x86/ras/Kconfig +source "arch/x86/ras/Kconfig" endif diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig index 5422523..5fbfabb 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig @@ -383,7 +383,7 @@ config INTEL_QUARK_DTS_THERMAL underlying BIOS/Firmware. menu "ACPI INT340X thermal drivers" -source drivers/thermal/int340x_thermal/Kconfig +source "drivers/thermal/int340x_thermal/Kconfig" endmenu config INTEL_BXT_PMIC_THERMAL diff --git a/drivers/w1/Kconfig b/drivers/w1/Kconfig index 6743bde..dbb41f4 100644 --- a/drivers/w1/Kconfig +++ b/drivers/w1/Kconfig @@ -25,7 +25,7 @@ config W1_CON 2. Userspace commands. Includes read/write and search/alarm search commands. 3. Replies to userspace commands. -source drivers/w1/masters/Kconfig -source drivers/w1/slaves/Kconfig +source "drivers/w1/masters/Kconfig" +source "drivers/w1/slaves/Kconfig" endif # W1 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 1af29b8..08a95da 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -439,7 +439,7 @@ config DEBUG_KERNEL menu "Memory Debugging" -source mm/Kconfig.debug +source "mm/Kconfig.debug" config DEBUG_OBJECTS bool "Debug object operations" @@ -1609,7 +1609,7 @@ config LATENCYTOP Enable this option if you want to use the LatencyTOP tool to find out which userspace is blocking on what kernel operations. -source kernel/trace/Kconfig +source "kernel/trace/Kconfig" config PROVIDE_OHCI1394_DMA_INIT bool "Remote debugging over FireWire early on boot" diff --git a/security/Kconfig b/security/Kconfig index d9aa521..e4fe2f3 100644 --- a/security/Kconfig +++ b/security/Kconfig @@ -4,7 +4,7 @@ menu "Security options" -source security/keys/Kconfig +source "security/keys/Kconfig" config SECURITY_DMESG_RESTRICT bool "Restrict unprivileged access to the kernel syslog" @@ -230,14 +230,14 @@ config STATIC_USERMODEHELPER_PATH If you wish for all usermode helper programs to be disabled, specify an empty string here (i.e. ""). -source security/selinux/Kconfig -source security/smack/Kconfig -source security/tomoyo/Kconfig -source security/apparmor/Kconfig -source security/loadpin/Kconfig -source security/yama/Kconfig +source "security/selinux/Kconfig" +source "security/smack/Kconfig" +source "security/tomoyo/Kconfig" +source "security/apparmor/Kconfig" +source "security/loadpin/Kconfig" +source "security/yama/Kconfig" -source security/integrity/Kconfig +source "security/integrity/Kconfig" choice prompt "Default security module" diff --git a/security/integrity/Kconfig b/security/integrity/Kconfig index da95658..877af1f 100644 --- a/security/integrity/Kconfig +++ b/security/integrity/Kconfig @@ -66,7 +66,7 @@ config INTEGRITY_AUDIT be enabled by specifying 'integrity_audit=1' on the kernel command line. -source security/integrity/ima/Kconfig -source security/integrity/evm/Kconfig +source "security/integrity/ima/Kconfig" +source "security/integrity/evm/Kconfig" endif # if INTEGRITY From patchwork Tue Dec 11 11:01:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153425 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475070ljp; Tue, 11 Dec 2018 03:02:09 -0800 (PST) X-Google-Smtp-Source: AFSGD/X0NjsduHSXsdLhEXXAAiIVy9L2u+XDHwP+gHJ5oycCrd9tQPkwSmCMHZIcrJiigJAI/gFe X-Received: by 2002:a63:af18:: with SMTP id w24mr14260903pge.385.1544526129392; Tue, 11 Dec 2018 03:02:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526129; cv=none; d=google.com; s=arc-20160816; b=ZDmbk68oj26bQcvQ9E3qGzTzdMNVltL9u2p0je/gmfJU6mwltT6mTymeBmTFDu+pVg Rj96Cg9UFCsiBizpOhzxW1HL7QttKTkrCx4iUABGctbVc7e9VPRkUdGx6hDndjYqk6TF ZKppP+oTbTE5sJTA8m42oSlhvqlcfMIA0ucHh46BQ0ySWZt/tmL+BbeC/aARCT0+0Ef1 r35+RI+2pvD6QtEKwIe4SQIIcodxQwr4QP47t3fx7DPOvhWVI6EaLKhNz4LPTTpmq249 Jdi3hT46W587ypTtZYrAGNJO3qrpCCjKRqvXbnpgh+ZrRfmztLJgwCStmnA2NXENjQlq Np3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=XFpsRQgZt6zvb7DKTN9C3r7E7nhS5P7194SgXasbn1g=; b=PULeT6SnuQP8Q0f6dS9xFCZb1gJsGR2PYAVD3iF67mm+XeoY1Wdh4aPdEBD7YNQfcA Wr9T3KF385dadtzWCzdqIihA+m7UEreIMO04ni5+xHcRc2at1LtqfUIx3oRbFqsJQqBg aVWo3roulbY8KVEWo3qzVtQcUfsFoIBT6YGx/1tPa51eBfY/n8QBxj6aNBqD+K3BapsE QIFav0nJF3T81rwOKKg8PedgyqPypRwJSl7i907jWgc8Lh2EZy+fHy09Lkl6OTvO3kU3 d2qFH8gd7TFN+8krXtxUFCaN0fhqWJmyG+y1D8JgHSFd19+yhQGKi7oTKaUTz3ELmAIC fOOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="ZF/3yxsw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3si11706031plr.178.2018.12.11.03.02.09; Tue, 11 Dec 2018 03:02:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="ZF/3yxsw"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726792AbeLKLCH (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:07 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36861 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726712AbeLKLBu (ORCPT ); Tue, 11 Dec 2018 06:01:50 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C5x017210; Tue, 11 Dec 2018 20:01:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C5x017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526089; bh=XFpsRQgZt6zvb7DKTN9C3r7E7nhS5P7194SgXasbn1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZF/3yxswEeQ9IdyVhvua72SdlmD73OUFIQJj9jYCgIcEAbe+4w8E2zIU1PYYFZgwt mkQTUuCvmoTsaZ4Hf3csIV6UroMQx9+j7Wt6DgBhb0TffRSYaYCKVIuCZeOq3S1mwF DIJdeyb6/jcr0Y3ptp/N1/sQIS5vV3HuaCsD34WGjptaShH68O8P0K66DJ71r1m2c4 pLWAzK5lCAEWCUrF9l/Q+mjzXSvEKuCBu2gt4gxVWyAbgdP6hVYbEInQcViVj6HRfV khe1rDJOChbZQt/R0fzlJbyYGQ5rvOJuF6W8V/b1NW9hp8xdPZ1QLwPx6ZvRna1OLy jkCQIaJd/e46w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 22/27] kconfig: ban the use of '.' and '/' in unquoted words Date: Tue, 11 Dec 2018 20:01:05 +0900 Message-Id: <1544526070-16690-23-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In my understanding, special characters such as '.' and '/' are supported in unquoted words to use bare file paths in the source statement. With all included file paths quoted in the previous commit, we can drop this. Signed-off-by: Masahiro Yamada --- scripts/kconfig/preprocess.c | 3 +-- scripts/kconfig/zconf.l | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/preprocess.c b/scripts/kconfig/preprocess.c index 5ca2df7..b028a48 100644 --- a/scripts/kconfig/preprocess.c +++ b/scripts/kconfig/preprocess.c @@ -555,8 +555,7 @@ char *expand_string(const char *in) static bool is_end_of_token(char c) { - /* Why are '.' and '/' valid characters for symbols? */ - return !(isalnum(c) || c == '_' || c == '-' || c == '.' || c == '/'); + return !(isalnum(c) || c == '_' || c == '-'); } /* diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index defb722..b715af9 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -167,7 +167,7 @@ n [A-Za-z0-9_-] BEGIN(STRING); } \n BEGIN(INITIAL); return T_EOL; - ({n}|[/.])+ { + {n}+ { const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); if (id && id->flags & TF_PARAM) { yylval.id = id; @@ -177,7 +177,7 @@ n [A-Za-z0-9_-] yylval.string = text; return T_WORD; } - ({n}|[/.$])+ { + ({n}|$)+ { /* this token includes at least one '$' */ yylval.string = expand_token(yytext, yyleng); if (strlen(yylval.string)) From patchwork Tue Dec 11 11:01:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153426 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475150ljp; Tue, 11 Dec 2018 03:02:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/VhNXWDg79SJO9PGprFUHVpsK7jcQpC11Z8kAxXPqUNp5r6IwfSYH7Cs38cwV6/QL3Lag27 X-Received: by 2002:a63:d34a:: with SMTP id u10mr14422966pgi.301.1544526134293; Tue, 11 Dec 2018 03:02:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526134; cv=none; d=google.com; s=arc-20160816; b=B5Nm8d9g+ksHfc4XC8hcSOgLd/O5st//qn7hOiIP+PT+w4WBnO/6Uey13+fFVGJECj rD2kpCx0WADxOIwwWYxcqDyM7l5q4kO6VQSexsfOBvF93klkSONNrKlJRGQ/xiWINocS xovzsydkN688sDRU6ZRz1Nyu/LTnlx7GZMWfhtwZYOpGCbHBrNCoTOu41JAoc/W3JJ0K /QQn47ZbcbpS8KvzqSJdAwgJLJgFsWdWVZhfZ05RT8n2MwoTAoyD1vWi3pLtXQ02RL3W s4FkdmoFmtYv0e36xUEwfu1KCFpHIc4EiCTSO25vJB3DeQoDorh6oobQTfVfWbeCCekn et/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=KZHPFlAZWooUhIS11wcnu+1SJRNuDkD/aVf/1EZWOrA=; b=ygxMzufHqOVfM7EGPWNJsCQszYNxB+Vrn7FkYCIHLL/PcF8IA6sy8KxAvrOFl5++RC QI17G7259fNLc6EAVE7Q4fcjW7Df6pL1au5bpkoOoIzqzTSkU945IS7pdKHSoUuo5J0u zl15a7nRNfRz8BaQ2nhVBSLYp6UXHnNjvppE3vXfKz7HGCcoigXxmRTJjMKn17NILHDe YbKIRmEpAMiK3qKZFJhZ8Y1nYOkbOEEXXifsjMsprccxwqtf/HMhDvafu3r1v0y/o9PW ziENxaaNxYPq0X20wazLZkgwThHCyWJQDNb9gNNousrhWU5KWKcQiGpx4Uks1gHs8ytj yrOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=n9Qd2Cc+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si11318787pgh.224.2018.12.11.03.02.13; Tue, 11 Dec 2018 03:02:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=n9Qd2Cc+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726780AbeLKLCG (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:06 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36860 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbeLKLBu (ORCPT ); Tue, 11 Dec 2018 06:01:50 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C60017210; Tue, 11 Dec 2018 20:01:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C60017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526090; bh=KZHPFlAZWooUhIS11wcnu+1SJRNuDkD/aVf/1EZWOrA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n9Qd2Cc+DYgjZ3SxIOHjYtVf/sXOeR4g1bKvmidsLY+l6TwtqSDB/tAPW+4R9ruLP ndebAouoPY99CL0gj1Wyx2kU18m2GvGfGQO9f1K1B7ayg4HgUbJOP0V3v54vgwJnxo R/ckKE/RWy6RceffLUWGYZkEGYuggTUv87kL9M1Y4kTDm18kuDbT6ETI3fwxiTg8FF 68tArtXxLEwWVNBZ8Rwmg+5tovpiTtoK+BSkH1ipREebqmHW/VI5h84PeecnnXLUml hUyf7EJUu58zQbkpZ235rUEasUwCGwV7XRDJb5pA2QyhXl+C/Y4gR8vGkn0oKR1s0N 4hmBVOzdkSBCw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 23/27] kconfig: refactor end token rules Date: Tue, 11 Dec 2018 20:01:06 +0900 Message-Id: <1544526070-16690-24-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T_ENDMENU, T_ENDCHOICE, T_ENDIF are the last users of kconf_id associated with yylval. Refactor them to not use it. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.y | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 3c44d67..36cffc0 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -24,7 +24,8 @@ int yylex(void); static void yyerror(const char *err); static void zconfprint(const char *err, ...); static void zconf_error(const char *err, ...); -static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken); +static bool zconf_endtoken(const char *tokenname, + const char *expected_tokenname); struct symbol *symbol_hash[SYMBOL_HASHSIZE]; @@ -98,7 +99,7 @@ static struct menu *current_menu, *current_entry; %type type bool_or_tri default %type expr %type if_expr -%type end +%type end %type if_entry menu_entry choice_entry %type word_opt assign_val %type assign_op @@ -256,7 +257,7 @@ choice_entry: choice choice_option_list choice_end: end { - if (zconf_endtoken($1, T_CHOICE, T_ENDCHOICE)) { + if (zconf_endtoken($1, "choice")) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endchoice\n", zconf_curname(), zconf_lineno()); } @@ -330,7 +331,7 @@ if_entry: T_IF expr T_EOL if_end: end { - if (zconf_endtoken($1, T_IF, T_ENDIF)) { + if (zconf_endtoken($1, "if")) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endif\n", zconf_curname(), zconf_lineno()); } @@ -355,7 +356,7 @@ menu_entry: menu menu_option_list menu_end: end { - if (zconf_endtoken($1, T_MENU, T_ENDMENU)) { + if (zconf_endtoken($1, "menu")) { menu_end_menu(); printd(DEBUG_PARSE, "%s:%d:endmenu\n", zconf_curname(), zconf_lineno()); } @@ -445,9 +446,9 @@ prompt: T_WORD | T_WORD_QUOTE ; -end: T_ENDMENU T_EOL { $$ = $1; } - | T_ENDCHOICE T_EOL { $$ = $1; } - | T_ENDIF T_EOL { $$ = $1; } +end: T_ENDMENU T_EOL { $$ = "menu"; } + | T_ENDCHOICE T_EOL { $$ = "choice"; } + | T_ENDIF T_EOL { $$ = "if"; } ; if_expr: /* empty */ { $$ = NULL; } @@ -530,35 +531,21 @@ void conf_parse(const char *name) sym_set_change_count(1); } -static const char *zconf_tokenname(int token) -{ - switch (token) { - case T_MENU: return "menu"; - case T_ENDMENU: return "endmenu"; - case T_CHOICE: return "choice"; - case T_ENDCHOICE: return "endchoice"; - case T_IF: return "if"; - case T_ENDIF: return "endif"; - case T_DEPENDS: return "depends"; - case T_VISIBLE: return "visible"; - } - return ""; -} - -static bool zconf_endtoken(const struct kconf_id *id, int starttoken, int endtoken) +static bool zconf_endtoken(const char *tokenname, + const char *expected_tokenname) { - if (id->token != endtoken) { + if (strcmp(tokenname, expected_tokenname)) { zconf_error("unexpected '%s' within %s block", - id->name, zconf_tokenname(starttoken)); + tokenname, expected_tokenname); yynerrs++; return false; } if (current_menu->file != current_file) { zconf_error("'%s' in different file than '%s'", - id->name, zconf_tokenname(starttoken)); + tokenname, expected_tokenname); fprintf(stderr, "%s:%d: location of the '%s'\n", current_menu->file->name, current_menu->lineno, - zconf_tokenname(starttoken)); + expected_tokenname); yynerrs++; return false; } From patchwork Tue Dec 11 11:01:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153427 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475294ljp; Tue, 11 Dec 2018 03:02:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/XMohy3QWfDDot3k68lHoBTEA2R22hfyXtN10EcrHZ6lOLlrwa9N0tU9bctOkpIi+k8uwbJ X-Received: by 2002:a63:ce08:: with SMTP id y8mr13991694pgf.388.1544526141825; Tue, 11 Dec 2018 03:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526141; cv=none; d=google.com; s=arc-20160816; b=iyFcI/4otqGcLF3alRg0uiisnn+BTzpshsSJbYNVPS2blJ5HsGjfXNW+nM2wjxcxFs W9K0ZZA/IRZBt0ENABg1c7L0V665a9klxORg0KOlSw1/Gl3ORIQ4t+ItQ3L+BGT+IUlh L6NC0N19uxEcNTgZUsg1oomR5XipR6WSnj8JtUI3tedHTkkXdeWn6vAQ/n8MyWzdT1y4 H9sv5Yzqa4iV9rD7WwNKHopkLyW6dudKRkdSGGYWaPbv9qIl2qpX/X0bTppSIDlk6CCz wMbPyL7mhZjaXwoC7+85B4r7GhAf1GSQ7APXBXRxF9/fsNNAQ3nhqJ1IwaRivYLwAXvf 4GpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=hzYyyrxQPXTdQIdYAboEbvyEEikywwYe5oI5dt1P3mQ=; b=JaPa/HORGua6Ws2KYfT5AwEgzoH+WRLhGtLOs9A2dqXjG72AW+pH603OJfpnuNbRFP FCBRbL3RObn4LUpRGoy4SJ+ma6t36A7iKg+O/QYf6ODgeZx8IrVFhFW71xM1pqTGVBaH KH411hsnF1lrxhKLyC5EOFvRs4lQMfkzYA6eyFc/QL8WHJWBCKeqTYJAR1wQW4VvXot9 /cmqRMCvJKDTme+EXWwKYMUZyd5P5JRmjDNAMY9YKnUZ9cFP2mWWj3wBfmMmbRISnZBq 47oCZN0UEKQhe57g0Y7d5tUROJoTjqvb21TcsMyRKPgjegTRbl8ysS3zrs0aON9Q/Ltm vqMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2csVzN7A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19si11573900pgc.96.2018.12.11.03.02.21; Tue, 11 Dec 2018 03:02:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2csVzN7A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbeLKLCT (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:19 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36859 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbeLKLBt (ORCPT ); Tue, 11 Dec 2018 06:01:49 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C61017210; Tue, 11 Dec 2018 20:01:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C61017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526090; bh=hzYyyrxQPXTdQIdYAboEbvyEEikywwYe5oI5dt1P3mQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2csVzN7AzTqpD+zj9d5WfbxsrqC0uVfoUtK8CkVpMoiaCtmZbP1nzk5psmOgpOyi7 zpQdQblf1K0zbT6nFKIcY23B29MLAJztgTp09YP7kqKLIGb3YBBkh3K7fS9ukzFOWh 9SZ4YlhISEMZb4OGA1HvhjN9DENDVBugYGv7DFJJZ43zmyJAenTT4c1n6m3ahbcIea UceMwDr1sOXqNlcdre6bHynmjGX+IkNXK+M1wvFgw/5A2mghnCfuu7TzofdcvZxqxw DVOW3nioO7DTc4ZUMb7rN7YWLLWzGiMOcGNZTe0pT9I2OW8Q6hplcrLR4aWnsQuoQF dGjmr6J5s6sNw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 24/27] kconfig: stop associating kconf_id with yylval Date: Tue, 11 Dec 2018 20:01:07 +0900 Message-Id: <1544526070-16690-25-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The lexer has conventionally associated kconf_id data with yylval to carry additional information to the parser. No token is relying on this any more. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 2 -- scripts/kconfig/zconf.y | 41 ++++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 23 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index b715af9..c8823a4 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -111,7 +111,6 @@ n [A-Za-z0-9_-] current_pos.lineno = yylineno; if (id && id->flags & TF_COMMAND) { BEGIN(PARAM); - yylval.id = id; return id->token; } alloc_string(yytext, yyleng); @@ -170,7 +169,6 @@ n [A-Za-z0-9_-] {n}+ { const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); if (id && id->flags & TF_PARAM) { - yylval.id = id; return id->token; } alloc_string(yytext, yyleng); diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 36cffc0..c611d70 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -40,50 +40,49 @@ static struct menu *current_menu, *current_entry; struct symbol *symbol; struct expr *expr; struct menu *menu; - const struct kconf_id *id; enum symbol_type type; enum variable_flavor flavor; } -%token T_MAINMENU -%token T_MENU -%token T_ENDMENU -%token T_SOURCE -%token T_CHOICE -%token T_ENDCHOICE -%token T_COMMENT -%token T_CONFIG -%token T_MENUCONFIG -%token T_HELP %token T_HELPTEXT -%token T_IF -%token T_ENDIF -%token T_DEPENDS -%token T_OPTIONAL -%token T_PROMPT -%token T_SELECT -%token T_IMPLY -%token T_RANGE -%token T_VISIBLE -%token T_ON %token T_WORD %token T_WORD_QUOTE %token T_ALLNOCONFIG_Y %token T_BOOL +%token T_CHOICE %token T_CLOSE_PAREN %token T_COLON_EQUAL +%token T_COMMENT +%token T_CONFIG %token T_DEFAULT %token T_DEFCONFIG_LIST %token T_DEF_BOOL %token T_DEF_TRISTATE +%token T_DEPENDS +%token T_ENDCHOICE +%token T_ENDIF +%token T_ENDMENU +%token T_HELP %token T_HEX +%token T_IF +%token T_IMPLY %token T_INT +%token T_MAINMENU +%token T_MENU +%token T_MENUCONFIG %token T_MODULES +%token T_ON %token T_OPEN_PAREN %token T_OPTION +%token T_OPTIONAL %token T_PLUS_EQUAL +%token T_PROMPT +%token T_RANGE +%token T_SELECT +%token T_SOURCE %token T_STRING %token T_TRISTATE +%token T_VISIBLE %token T_EOL %token T_ASSIGN_VAL From patchwork Tue Dec 11 11:01:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153428 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475400ljp; Tue, 11 Dec 2018 03:02:27 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wn+sSjE+NvbF515PdR3Tl/0jLmgqos/gevngZkLXXLF4H/UdYRTmnRm3TtZy3n2ADTICBh X-Received: by 2002:a63:2315:: with SMTP id j21mr14370873pgj.297.1544526147333; Tue, 11 Dec 2018 03:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526147; cv=none; d=google.com; s=arc-20160816; b=H3ftYfyXGGG/lYacXQsnvlcbvLktSTvCICBZJEgkG6AP6agxOxbpQLk2NBA8mUqL+1 FqkKfkC312PcwtLLL3WZOb4bYTbWeXvkENxK8dPbXEYOBJ1RyWzhB0NzIxC4IwwqDIW7 2Cofbx5ctosDag0y7LfDaA/bBTAsw2wG7uFthi52QurcWmSGE1udZW0PotrneDDvv+hJ fw2yyCy47D5ABYq2Mvg12kIGXQYwrQhK7fCTPQuzZ+GTisvg/N1bCFw7C/2bQFhbVo4E JijDGMG74n/oo2ze4wxQCX/SvEV+PmXINPgB5zn/O5N8GtHQkOg+fqbRMhPTzIkfvi/7 Bj/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=6Lvtg2dB6yAFCoRPqr59hv7P+Ii7lc6zWyJld8N69xA=; b=kzBuA05kHQSRVS2VpUI3bubfNy8XcQW9wXtAJB0GsASH0wPrpVk+nYNgi19FYbHtPt wS+93vKEZ5qNSHK4MRrXNdznRdQAFcGQnk8DyUNcYOWC4Pr5uz6JvHS8KdjOVa/UJoR/ +OApV6IQuUJPAfbFqw1AZJMYuvwv8dzfEXiIhn9qB0XceARcW6hcbEzWxRhNsIwnFyhf Xe0feeY6dZHR65bC6bBlObDTCMOk14K5Q7yziXHe3ghnLaIX6i09l/goCq6X0u4HC6NM e3rVn0VjurNi+FHSOXtyLyMTiHUGvSONYoEx0ZI1XuBv1LUhyof023MVOxpyYNi+lI3F 5phw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="aw/RnSCy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d66si12890969pfg.36.2018.12.11.03.02.27; Tue, 11 Dec 2018 03:02:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="aw/RnSCy"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726812AbeLKLCZ (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:25 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36854 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726706AbeLKLBs (ORCPT ); Tue, 11 Dec 2018 06:01:48 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C62017210; Tue, 11 Dec 2018 20:01:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C62017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526091; bh=6Lvtg2dB6yAFCoRPqr59hv7P+Ii7lc6zWyJld8N69xA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aw/RnSCyPCDBoQLgHMgFn4RzvL+v3J93fGMiglKTHAW42E71T8ru8RRRWQHU1x0oE yFSBBbLw7TfUM+4rjrb1PXKR8e7LBC3LyeZGxEQNMKxhUiHrjDTSrSW8CnGOjT+BPe kYMFohGGSZmXG8gGAAYGm2pBgDhw5pCRmr9BWuoO7VhhyVVRPqSo/SoxnTCy/NpQxV RU0wZ1uBEAFUn9BIN0nIWfDjGIPvByFxJVVzhE7xRbDEGDfICqBQ2za0kEOZ1ZqAQn INjifWIrVhI02JQpXivFjSSrcEBeA8wVCn1vDv1aRcL94X62Elu57aDSJ00V5O7wdQ Mpoe3EpIO+a9w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 25/27] kconfig: switch to ASSIGN_VAL state in the second lexer Date: Tue, 11 Dec 2018 20:01:08 +0900 Message-Id: <1544526070-16690-26-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To simplify the generated lexer, switch to the ASSIGN_VAL state in the hand-made lexer. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index c8823a4..d462507 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -25,6 +25,7 @@ static struct { int lineno; } current_pos; +static int prev_prev_token = T_EOL; static int prev_token = T_EOL; static char *text; static int text_size, text_asize; @@ -124,9 +125,9 @@ n [A-Za-z0-9_-] return T_WORD; free(yylval.string); } - "=" { BEGIN(ASSIGN_VAL); return T_EQUAL; } - ":=" { BEGIN(ASSIGN_VAL); return T_COLON_EQUAL; } - "+=" { BEGIN(ASSIGN_VAL); return T_PLUS_EQUAL; } + "=" return T_EQUAL; + ":=" return T_COLON_EQUAL; + "+=" return T_PLUS_EQUAL; [[:blank:]]+ . warn_ignored_character(*yytext); \n { @@ -294,6 +295,11 @@ repeat: if ((prev_token == T_EOL || prev_token == T_HELPTEXT) && token == T_EOL) goto repeat; + if (prev_prev_token == T_EOL && prev_token == T_WORD && + (token == T_EQUAL || token == T_COLON_EQUAL || token == T_PLUS_EQUAL)) + BEGIN(ASSIGN_VAL); + + prev_prev_token = prev_token; prev_token = token; return token; From patchwork Tue Dec 11 11:01:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153429 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp475434ljp; Tue, 11 Dec 2018 03:02:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/Uw7XyFyojbUBfb8a6Q8wTWrGLx6Wfkizr0I66TjyltKax+UW9zNEWsIMXBnFG0nbOufWlx X-Received: by 2002:a62:4e83:: with SMTP id c125mr16051308pfb.101.1544526149485; Tue, 11 Dec 2018 03:02:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526149; cv=none; d=google.com; s=arc-20160816; b=cH/Us42Qpv27SmXHs0R48ScKGhfwv5tLoj6m1ytdqHBwyb6mafrZ5Ww7EU7UoA5Mm8 YpXtYtMRCV+63kZcThgrNXs1BBXgvIq0Uab/nnc/9fJC/v4GKesh4iQ1vgHYzHhc420K 2uQ3oM8ibuQNaGU47xhUslB5zoP4B+zr9QOa+CfsVEsA3a/+OgMO3DUC5doiYuS1AUO6 u4blVRIOqITg9VNKdBRlJ2PT075aTI2Z90bB9HixJ2Bv6/KcAOMbszIBT/JqoXHRCZHD x030bXyIO/yzrWgxEkg5LP3l4m0Spsm0uI4zZeVCOda/SZP20nYh/TFFOuwKU4ltuAnk Ycmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=H7uIjhRZd78YuhKatcgyhcv31egGnNdh5y9Y0vrPiac=; b=R/lKNvFDFS8WYibIQeqfpCzY3zz6EvnNzNu9VnKRT23eQxpQ4OZWZgBNDSKwpDqXbp /gM0yrBMkXttQKRdNeCa3EcOj6cu6Gs3mGHEsEfGXrO0MvEZ5gsvcZHrtZNQmU4ap081 TpsVS2/Gvi8kfkOyWAw+vYkONe7aatS9yB91+ZjLPx5fo3od/4Hn+xEM4K0Hje8mczPc QeeYEPFCJwe9vvtVgLkUGuz1jTW9aFnRkeDBA9YirxdZtFkcgwySKXUvtyb9GS3oABO7 HfI4KxnC7Wo2McXXEPtxyqGx33vMDxWJwfBmtwISo1e93mltwG+fH3JhBSQVIWRRWzIC EGdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FUBA9gOB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si11126530pgk.103.2018.12.11.03.02.29; Tue, 11 Dec 2018 03:02:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=FUBA9gOB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbeLKLC1 (ORCPT + 31 others); Tue, 11 Dec 2018 06:02:27 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36853 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726705AbeLKLBs (ORCPT ); Tue, 11 Dec 2018 06:01:48 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C63017210; Tue, 11 Dec 2018 20:01:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C63017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526092; bh=H7uIjhRZd78YuhKatcgyhcv31egGnNdh5y9Y0vrPiac=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUBA9gOBQNlZQC+gbVwyI/JVuq2QwxVbg4+BTaUgI5eWsBKric0VcEtND1MKaxGVw p4VUq9iVDrh9e9GUD5YxVvLxjqiU/C8yabrIFv/az7eJ3Q3oGtaBW2C+aoo8BNPZLQ afdAVOtDI55NTh4DgADa+xvm/DXTZMepBthKzxhvrG2p1OtIx5bu3ls8MsFLH6Q+kI 0v9x1LWWZPW27rl6UN2HA+zdPHx06iUVAlJpZghLoM6Gku/RID9Mzc4I/ajSdrp0Bl d3V8kmZI5BDHqH6/CWFCUrYJ0bYWQGrooxHgPfntnPSs9IE6PMfx69weLiiyIvkQ2N 8Zmaa7A+0sVwg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 26/27] kconfig: update current_pos in the second lexer Date: Tue, 11 Dec 2018 20:01:09 +0900 Message-Id: <1544526070-16690-27-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To simplify the generated lexer, let the hand-made lexer update the file name and line number for the parser. I tested this with DEBUG_PARSE, and confirmed the same file names and line numbers were dumped. Signed-off-by: Masahiro Yamada --- scripts/kconfig/zconf.l | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) -- 2.7.4 diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index d462507..f0734abe 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -108,8 +108,6 @@ n [A-Za-z0-9_-] { {n}+ { const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); - current_pos.file = current_file; - current_pos.lineno = yylineno; if (id && id->flags & TF_COMMAND) { BEGIN(PARAM); return id->token; @@ -291,9 +289,21 @@ int yylex(void) repeat: token = yylex1(); - /* Do not pass unneeded T_EOL to the parser. */ - if ((prev_token == T_EOL || prev_token == T_HELPTEXT) && token == T_EOL) - goto repeat; + if (prev_token == T_EOL || prev_token == T_HELPTEXT) { + if (token == T_EOL) { + /* Do not pass unneeded T_EOL to the parser. */ + goto repeat; + } else { + /* + * For the parser, update file/lineno at the first token + * of each statement. Generally, \n is a statement + * terminator in Kconfig, but it is not always true + * because \n could be escaped by a backslash. + */ + current_pos.file = current_file; + current_pos.lineno = yylineno; + } + } if (prev_prev_token == T_EOL && prev_token == T_WORD && (token == T_EQUAL || token == T_COLON_EQUAL || token == T_PLUS_EQUAL)) From patchwork Tue Dec 11 11:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 153423 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp474892ljp; Tue, 11 Dec 2018 03:02:01 -0800 (PST) X-Google-Smtp-Source: AFSGD/ULr2QJGKN6hwMRX+NA6heaWK3VqalpVYtxGahv7k0hidsR1yxHRIaNXtOFJM/dSTGafLPE X-Received: by 2002:a65:610d:: with SMTP id z13mr14321288pgu.427.1544526121326; Tue, 11 Dec 2018 03:02:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544526121; cv=none; d=google.com; s=arc-20160816; b=SRuNQhok7ImUw1DuyhK7IPWo4+rmZ8U5OtoikssO/ZiU+QE0DVJfEOzMxbqRi5MNFB IWt4DnGEX2FSxvy27ybK48ntYyP3S/LmWIu3CSTJhgTUZw0PGqiPad4YIPeOFnTUEm8F NLMu2P3AtjCnukIiAo9RgGf63EZUfYD5npj7IWWOwJS2nCrfoeVMSz2qY2ylCbIQax5u jb/umRVDSNojQBYi53xiqjwv7iNZqGho/OLe4QAXlxLPujqcw753BGCCCJSM/jMuesVo 6iM9AScsmb67cCGZx0Of985n9FZCg4U8JXbJ0owze5vUCabRGwbi9JVrypHFuH+yfZpy OG3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=22k3gslRy66qpM0SynETEJnzaIJ5tUz4rl7Q+utnw08=; b=TFkUfEVwSnBv+VQszHQky86l10Krb6tTmUya0DKorx6uh0TCEQw7X1dLEvcrZB3ZZX OHzQDY43mdesncZfRnE6VAAc+tDKO1qQ+y8cLyKsU+JvyITRMXAK3AielX7MTcih0Ndw /6+FQdONygNTfF6I5zi5eHBB2POm8Zo+JQrYExlAtugbcWdpVhaIVMahxbK7ERhtQ5TT ljJVHUJVqpKl4CZf4kGTfC/vW9DbLc2Neq5KIm6FSWKuGl0LsnY50K1yOZdd8T9flAKF GrRiBErbHlUCuYjvqkHKK14wm3YVnAkTxjaM//SVVU4oqeuLPKntGNBlkVHIUVWqKFPl 897g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=E21Onrse; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si11583492pgv.277.2018.12.11.03.02.00; Tue, 11 Dec 2018 03:02:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=E21Onrse; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726756AbeLKLBx (ORCPT + 31 others); Tue, 11 Dec 2018 06:01:53 -0500 Received: from conuserg-11.nifty.com ([210.131.2.78]:36866 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726711AbeLKLBt (ORCPT ); Tue, 11 Dec 2018 06:01:49 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id wBBB1C64017210; Tue, 11 Dec 2018 20:01:32 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com wBBB1C64017210 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1544526092; bh=22k3gslRy66qpM0SynETEJnzaIJ5tUz4rl7Q+utnw08=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E21OnrseDmkE+FGGhW2I0L53PVKi2rBm2GLf8sfpLaNHn8GjTXYn7LHFskhti5AdY Y9UjSOY7YZ4jpgSialOT3+O2/WVJf3bua5VWMEah0bE+g4h60c0rEYIx8L8SCRKu/+ XB739DJqzta8irA9jFEM4iUC2H7aibfXnYcfog3uNh+37c9E4xg9loU/Qpram7qwYX Sy+CkSS2pkhHKrb17cjRUeuNoyZAbpT7IMLwQbfZ+ie9kBLtxOFzDZWAgMp5d6lbE0 /RCckVw+yNNBEpkN7wbR/Oh1ruPYwsldPsOkWQhQFF5d9khamU4biju78GW45Z/N0j hmzHl8mZI0ZNg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Ulf Magnusson , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH 27/27] kconfig: remove keyword lookup table entirely Date: Tue, 11 Dec 2018 20:01:10 +0900 Message-Id: <1544526070-16690-28-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> References: <1544526070-16690-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 7a88488bbc23 ("[PATCH] kconfig: use gperf for kconfig keywords") introduced gperf for the keyword lookup. Then, commit bb3290d91695 ("Remove gperf usage from toolchain") killed the gperf use. As a result, the linear keyword search was left. If we do not use gperf, there is no reason to have the separate table of the keywords. Move all keywords back to the lexer. I also refactored the lexer to remove the COMMAND and PARAM states. Signed-off-by: Masahiro Yamada --- scripts/kconfig/kconf_id.c | 49 --------------- scripts/kconfig/lkc.h | 9 --- scripts/kconfig/zconf.l | 153 ++++++++++++++++++++------------------------- scripts/kconfig/zconf.y | 5 -- 4 files changed, 69 insertions(+), 147 deletions(-) delete mode 100644 scripts/kconfig/kconf_id.c -- 2.7.4 diff --git a/scripts/kconfig/kconf_id.c b/scripts/kconfig/kconf_id.c deleted file mode 100644 index f8b222c..0000000 --- a/scripts/kconfig/kconf_id.c +++ /dev/null @@ -1,49 +0,0 @@ - -static struct kconf_id kconf_id_array[] = { - { "mainmenu", T_MAINMENU, TF_COMMAND }, - { "menu", T_MENU, TF_COMMAND }, - { "endmenu", T_ENDMENU, TF_COMMAND }, - { "source", T_SOURCE, TF_COMMAND }, - { "choice", T_CHOICE, TF_COMMAND }, - { "endchoice", T_ENDCHOICE, TF_COMMAND }, - { "comment", T_COMMENT, TF_COMMAND }, - { "config", T_CONFIG, TF_COMMAND }, - { "menuconfig", T_MENUCONFIG, TF_COMMAND }, - { "help", T_HELP, TF_COMMAND }, - { "---help---", T_HELP, TF_COMMAND }, - { "if", T_IF, TF_COMMAND|TF_PARAM }, - { "endif", T_ENDIF, TF_COMMAND }, - { "depends", T_DEPENDS, TF_COMMAND }, - { "optional", T_OPTIONAL, TF_COMMAND }, - { "default", T_DEFAULT, TF_COMMAND }, - { "def_bool", T_DEF_BOOL, TF_COMMAND }, - { "def_tristate", T_DEF_TRISTATE, TF_COMMAND }, - { "prompt", T_PROMPT, TF_COMMAND }, - { "bool", T_BOOL, TF_COMMAND }, - { "tristate", T_TRISTATE, TF_COMMAND }, - { "int", T_INT, TF_COMMAND }, - { "hex", T_HEX, TF_COMMAND }, - { "string", T_STRING, TF_COMMAND }, - { "select", T_SELECT, TF_COMMAND }, - { "imply", T_IMPLY, TF_COMMAND }, - { "range", T_RANGE, TF_COMMAND }, - { "visible", T_VISIBLE, TF_COMMAND }, - { "option", T_OPTION, TF_COMMAND }, - { "on", T_ON, TF_PARAM }, -}; - -#define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id)) - -static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len) -{ - int i; - - for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) { - struct kconf_id *id = kconf_id_array+i; - int l = strlen(id->name); - - if (len == l && !memcmp(str, id->name, len)) - return id; - } - return NULL; -} diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 5f4880a..ff6b3e4 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h @@ -30,9 +30,6 @@ static inline const char *CONFIG_prefix(void) #undef CONFIG_ #define CONFIG_ CONFIG_prefix() -#define TF_COMMAND 0x0001 -#define TF_PARAM 0x0002 - enum conf_def_mode { def_default, def_yes, @@ -41,12 +38,6 @@ enum conf_def_mode { def_random }; -struct kconf_id { - const char *name; - int token; - unsigned int flags; -}; - extern int yylineno; void zconfdump(FILE *out); void zconf_starthelp(void); diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index f0734abe..690108f 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -1,6 +1,6 @@ %option nostdinit noyywrap never-interactive full ecs %option 8bit nodefault yylineno -%x COMMAND HELP STRING PARAM ASSIGN_VAL +%x ASSIGN_VAL HELP STRING %{ /* * Copyright (C) 2002 Roman Zippel @@ -94,45 +94,73 @@ n [A-Za-z0-9_-] int str = 0; int ts, i; -[ \t]*#.*\n | -[ \t]*\n { - return T_EOL; -} -[ \t]*#.* -. { - unput(yytext[0]); - BEGIN(COMMAND); -} - - -{ - {n}+ { - const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); - if (id && id->flags & TF_COMMAND) { - BEGIN(PARAM); - return id->token; - } - alloc_string(yytext, yyleng); - yylval.string = text; - return T_WORD; - } - ({n}|$)+ { - /* this token includes at least one '$' */ - yylval.string = expand_token(yytext, yyleng); - if (strlen(yylval.string)) - return T_WORD; - free(yylval.string); - } - "=" return T_EQUAL; - ":=" return T_COLON_EQUAL; - "+=" return T_PLUS_EQUAL; - [[:blank:]]+ - . warn_ignored_character(*yytext); - \n { - BEGIN(INITIAL); - return T_EOL; - } -} +#.* /* ignore comment */ +[ \t]* /* whitespaces */ +\\\n /* escaped new line */ +\n return T_EOL; +"allnoconfig_y" return T_ALLNOCONFIG_Y; +"bool" return T_BOOL; +"choice" return T_CHOICE; +"comment" return T_COMMENT; +"config" return T_CONFIG; +"default" return T_DEFAULT; +"def_bool" return T_DEF_BOOL; +"defconfig_list" return T_DEFCONFIG_LIST; +"def_tristate" return T_DEF_TRISTATE; +"depends" return T_DEPENDS; +"endchoice" return T_ENDCHOICE; +"endif" return T_ENDIF; +"endmenu" return T_ENDMENU; +"help"|"---help---" return T_HELP; +"hex" return T_HEX; +"if" return T_IF; +"imply" return T_IMPLY; +"int" return T_INT; +"mainmenu" return T_MAINMENU; +"menuconfig" return T_MENUCONFIG; +"menu" return T_MENU; +"modules" return T_MODULES; +"on" return T_ON; +"optional" return T_OPTIONAL; +"option" return T_OPTION; +"prompt" return T_PROMPT; +"range" return T_RANGE; +"select" return T_SELECT; +"source" return T_SOURCE; +"string" return T_STRING; +"tristate" return T_TRISTATE; +"visible" return T_VISIBLE; +"||" return T_OR; +"&&" return T_AND; +"=" return T_EQUAL; +"!=" return T_UNEQUAL; +"<" return T_LESS; +"<=" return T_LESS_EQUAL; +">" return T_GREATER; +">=" return T_GREATER_EQUAL; +"!" return T_NOT; +"(" return T_OPEN_PAREN; +")" return T_CLOSE_PAREN; +":=" return T_COLON_EQUAL; +"+=" return T_PLUS_EQUAL; +\"|\' { + str = yytext[0]; + new_string(); + BEGIN(STRING); + } +{n}+ { + alloc_string(yytext, yyleng); + yylval.string = text; + return T_WORD; + } +({n}|$)+ { + /* this token includes at least one '$' */ + yylval.string = expand_token(yytext, yyleng); + if (strlen(yylval.string)) + return T_WORD; + free(yylval.string); + } +. warn_ignored_character(*yytext); { [^[:blank:]\n]+.* { @@ -144,49 +172,6 @@ n [A-Za-z0-9_-] . } -{ - "modules" return T_MODULES; - "defconfig_list" return T_DEFCONFIG_LIST; - "allnoconfig_y" return T_ALLNOCONFIG_Y; - "&&" return T_AND; - "||" return T_OR; - "(" return T_OPEN_PAREN; - ")" return T_CLOSE_PAREN; - "!" return T_NOT; - "=" return T_EQUAL; - "!=" return T_UNEQUAL; - "<=" return T_LESS_EQUAL; - ">=" return T_GREATER_EQUAL; - "<" return T_LESS; - ">" return T_GREATER; - \"|\' { - str = yytext[0]; - new_string(); - BEGIN(STRING); - } - \n BEGIN(INITIAL); return T_EOL; - {n}+ { - const struct kconf_id *id = kconf_id_lookup(yytext, yyleng); - if (id && id->flags & TF_PARAM) { - return id->token; - } - alloc_string(yytext, yyleng); - yylval.string = text; - return T_WORD; - } - ({n}|$)+ { - /* this token includes at least one '$' */ - yylval.string = expand_token(yytext, yyleng); - if (strlen(yylval.string)) - return T_WORD; - free(yylval.string); - } - #.* /* comment */ - \\\n ; - [[:blank:]]+ - . warn_ignored_character(*yytext); -} - { "$".* append_expanded_string(yytext); [^$'"\\\n]+ { @@ -197,7 +182,7 @@ n [A-Za-z0-9_-] } \'|\" { if (str == yytext[0]) { - BEGIN(PARAM); + BEGIN(INITIAL); yylval.string = text; return T_WORD_QUOTE; } else diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index c611d70..35c373d 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y @@ -110,11 +110,6 @@ static struct menu *current_menu, *current_entry; menu_end_menu(); } if_entry menu_entry choice_entry -%{ -/* Include kconf_id.c here so it can see the token constants. */ -#include "kconf_id.c" -%} - %% input: mainmenu_stmt stmt_list | stmt_list;