From: Nathan Chancellor <nathan@kernel.org>
To: Rob Herring <robh@kernel.org>, Saravana Kannan <saravanak@kernel.org>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, stable@vger.kernel.org,
Nathan Chancellor <nathan@kernel.org>
Subject: [PATCH] scripts/dtc: Remove unused dts_version in dtc-lexer.l
Date: Fri, 27 Mar 2026 22:38:55 +0100 [thread overview]
Message-ID: <20260327-dtc-drop-dts_version-v1-1-41066690aefd@kernel.org> (raw)
A recent strengthening of -Wunused-but-set-variable (enabled with -Wall)
in clang under a new subwarning, -Wunused-but-set-global, points out an
unused static global variable in dtc-lexer.lex.c (compiled from
dtc-lexer.l):
scripts/dtc/dtc-lexer.lex.c:641:12: warning: variable 'dts_version' set but not used [-Wunused-but-set-global]
641 | static int dts_version = 1;
| ^
This variable has been unused since commit 658f29a51e98 ("of/flattree:
Update dtc to current mainline."). Remove it to clear up the warning.
Cc: stable@vger.kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
This is commit 53373d1 ("dtc: Remove unused dts_version in dtc-lexer.l")
in upstream dtc. I sent it separately to make it easier to backport to
stable, along with updating the warning and hash to match the kernel's
version.
---
scripts/dtc/dtc-lexer.l | 3 ---
1 file changed, 3 deletions(-)
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index 15d585c80798..1b129b118b0f 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -39,8 +39,6 @@ extern bool treesource_error;
#define DPRINT(fmt, ...) do { } while (0)
#endif
-static int dts_version = 1;
-
#define BEGIN_DEFAULT() DPRINT("<V1>\n"); \
BEGIN(V1); \
@@ -101,7 +99,6 @@ static void PRINTF(1, 2) lexical_error(const char *fmt, ...);
<*>"/dts-v1/" {
DPRINT("Keyword: /dts-v1/\n");
- dts_version = 1;
BEGIN_DEFAULT();
return DT_V1;
}
---
base-commit: c369299895a591d96745d6492d4888259b004a9e
change-id: 20260327-dtc-drop-dts_version-153e81c6641c
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
next reply other threads:[~2026-03-27 21:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 21:38 Nathan Chancellor [this message]
2026-03-30 12:19 ` [PATCH] scripts/dtc: Remove unused dts_version in dtc-lexer.l Rob Herring
2026-03-30 14:16 ` Nathan Chancellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260327-dtc-drop-dts_version-v1-1-41066690aefd@kernel.org \
--to=nathan@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=robh@kernel.org \
--cc=saravanak@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox