* [PATCH stable] scripts/dtc: Remove unused dts_version in dtc-lexer.l
@ 2026-04-21 0:36 Nathan Chancellor
2026-05-05 19:44 ` Rob Herring (Arm)
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2026-04-21 0:36 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sasha Levin; +Cc: stable, devicetree, Nathan Chancellor
This patch is for stable only. Commit 5a09df20872c ("scripts/dtc: Update
to upstream version v1.7.2-69-g53373d135579") upstream applied it as
part of a regular scripts/dtc sync, which may be unsuitable for older
versions of stable where the warning it fixes is present.
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;
| ^
Remove it to clear up the warning, as it is truly unused.
Fixes: 658f29a51e98 ("of/flattree: Update dtc to current mainline.")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
This should apply cleanly to all supported stable branches.
---
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: 028ef9c96e96197026887c0f092424679298aae8
change-id: 20260420-stable-dts-unused-but-set-global-de9c05c12f6a
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH stable] scripts/dtc: Remove unused dts_version in dtc-lexer.l
2026-04-21 0:36 [PATCH stable] scripts/dtc: Remove unused dts_version in dtc-lexer.l Nathan Chancellor
@ 2026-05-05 19:44 ` Rob Herring (Arm)
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring (Arm) @ 2026-05-05 19:44 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: stable, devicetree, Greg Kroah-Hartman, Sasha Levin
On Mon, 20 Apr 2026 17:36:46 -0700, Nathan Chancellor wrote:
> This patch is for stable only. Commit 5a09df20872c ("scripts/dtc: Update
> to upstream version v1.7.2-69-g53373d135579") upstream applied it as
> part of a regular scripts/dtc sync, which may be unsuitable for older
> versions of stable where the warning it fixes is present.
>
> 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;
> | ^
>
> Remove it to clear up the warning, as it is truly unused.
>
> Fixes: 658f29a51e98 ("of/flattree: Update dtc to current mainline.")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> This should apply cleanly to all supported stable branches.
> ---
> scripts/dtc/dtc-lexer.l | 3 ---
> 1 file changed, 3 deletions(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-05 19:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 0:36 [PATCH stable] scripts/dtc: Remove unused dts_version in dtc-lexer.l Nathan Chancellor
2026-05-05 19:44 ` Rob Herring (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox