[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210927125437.818092-1-masahiroy@kernel.org>
Date: Mon, 27 Sep 2021 21:54:36 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-kbuild@...r.kernel.org
Cc: Masahiro Yamada <masahiroy@...nel.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] kconfig: narrow the scope of variables in the lexer
The variables, "ts" and "i", are used locally in the action of
the [ \t]+ pattern in the <HELP> start state.
Define them where they are used.
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
---
scripts/kconfig/lexer.l | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/kconfig/lexer.l b/scripts/kconfig/lexer.l
index 312cbad2d34d..efe487859308 100644
--- a/scripts/kconfig/lexer.l
+++ b/scripts/kconfig/lexer.l
@@ -85,7 +85,6 @@ n [A-Za-z0-9_-]
%%
int str = 0;
- int ts, i;
#.* /* ignore comment */
[ \t]* /* whitespaces */
@@ -196,6 +195,8 @@ n [A-Za-z0-9_-]
<HELP>{
[ \t]+ {
+ int ts, i;
+
ts = 0;
for (i = 0; i < yyleng; i++) {
if (yytext[i] == '\t')
--
2.30.2
Powered by blists - more mailing lists