Re: [PATCH] scripts/dtc: Remove unused dts_version in dtc-lexer.l

From: Rob Herring

Date: Mon Mar 30 2026 - 08:26:02 EST


On Fri, Mar 27, 2026 at 4:39 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxxxxxxx
> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> ---
> 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(-)

We don't take changes to dtc as we just sync with the upstream copy. I
saw you already submitted this upstream, so I will do a sync to pull
this in.

Rob