]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scripts/dtc: Remove unused dts_version in dtc-lexer.l
authorNathan Chancellor <nathan@kernel.org>
Tue, 21 Apr 2026 00:36:46 +0000 (17:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Apr 2026 13:30:17 +0000 (07:30 -0600)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/dtc/dtc-lexer.l

index 15d585c8079802d3ab6b00b28bb0aa7bfdb386e9..1b129b118b0f77ec0987a9cb6e2334f816fac792 100644 (file)
@@ -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;
                }