public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scripts/dtc: Remove unused dts_version in dtc-lexer.l
@ 2026-03-27 21:38 Nathan Chancellor
  2026-03-30 12:19 ` Rob Herring
  0 siblings, 1 reply; 3+ messages in thread
From: Nathan Chancellor @ 2026-03-27 21:38 UTC (permalink / raw)
  To: Rob Herring, Saravana Kannan
  Cc: Nick Desaulniers, Bill Wendling, Justin Stitt, devicetree,
	linux-kernel, llvm, stable, Nathan Chancellor

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>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-30 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27 21:38 [PATCH] scripts/dtc: Remove unused dts_version in dtc-lexer.l Nathan Chancellor
2026-03-30 12:19 ` Rob Herring
2026-03-30 14:16   ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox