Re: [PATCH] dtc: Remove unused dts_version in dtc-lexer.l
David Gibson <[email protected]> Fri, 27 Mar 2026 20:27:00 +1100
| Newsgroups | org.kernel.vger.devicetree-compiler |
|---|---|
| Message-ID | <acZNZHFZ3ajcNNdG@zatzit> |
--sweyUxxuARB000mp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Wed, Mar 25, 2026 at 05:13:44PM -0700, Nathan Chancellor 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.l:
>=20
> ../dtc-lexer.l:42:12: error: variable 'dts_version' set but not used [-=
Werror,-Wunused-but-set-global]
> 42 | static int dts_version =3D 1;
> | ^
>=20
> This variable has been unused since commit 4e1a0a0 ("Remove support for
> the legacy DTS source file format."). Remove it to clear up the warning.
>=20
> Signed-off-by: Nathan Chancellor <[email protected]>
Applied, thanks.
> ---
> dtc-lexer.l | 3 ---
> 1 file changed, 3 deletions(-)
>=20
> diff --git a/dtc-lexer.l b/dtc-lexer.l
> index 15d585c..1b129b1 100644
> --- a/dtc-lexer.l
> +++ b/dtc-lexer.l
> @@ -39,8 +39,6 @@ extern bool treesource_error;
> #define DPRINT(fmt, ...) do { } while (0)
> #endif
> =20
> -static int dts_version =3D 1;
> -
> #define BEGIN_DEFAULT() DPRINT("<V1>\n"); \
> BEGIN(V1); \
> =20
> @@ -101,7 +99,6 @@ static void PRINTF(1, 2) lexical_error(const char *fmt=
, ...);
> =20
> <*>"/dts-v1/" {
> DPRINT("Keyword: /dts-v1/\n");
> - dts_version =3D 1;
> BEGIN_DEFAULT();
> return DT_V1;
> }
>=20
> ---
> base-commit: caf7465c5d60a56e00ea8c6b6eeb4e443371f815
> change-id: 20260325-dtc-lexer-remove-dts_version-dbf0fcd4aec4
>=20
> Best regards,
> -- =20
> Nathan Chancellor <[email protected]>
>=20
>=20
--=20
David Gibson (he or they) | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you, not the other way
| around.
http://www.ozlabs.org/~dgibson
--sweyUxxuARB000mp
Content-Type: application/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmnGTVgACgkQzQJF27ox
2GdcSg/8C8OkfTJ9xCDgTzkq/U/fr/2Ge/QPajbGqPXwKpcWq+GAnXYYywPu2Zo+
1K35qsPF1R0gDYvw673wiY/y/PKFsYMWvywPUj5G9QNjckRdRb+CIM2+0eB972OI
yU3HuU0Tdfc2ZuHairqLJoRWrC71kzxaD1/oMd/vMd0PN82LCzfeVgiTGnLHUlYx
PGLVrGCjjLsy6+QdyxgeiPHen3q/EdvhIYXWVeWa/6dVxTRNBV9G4a/JytP3aqT5
MxFv4eWHfVQk31JfAXcnVJb8Pr0adVmltl3PwjREfbHHSintV4lZzEYOgM6RHTpN
B6qp2yE0RVO0sE/IXWTO3B7Ect8tY4GKeDPT+6oPB8qnASjgAizRI7XXenL1Ek25
Q3NriKAZrZdz6NWfJfRdIa2BzW5hj2WtXmQZVOIC0gSI/J/bqiVqgoOiYPOZmqDF
nq1j6rzgEhTnsixKERJnBjDK4IslGZpmCKMgwnsvYq2wl5eNesEBf7/8i5wfxZIp
8CX7xJuVD/wjv/qZ45WamSsyl1P02po15MgZMLw11EiGinM5ENFor2D6uBwQCNGy
1kwbWg8DucR7MJnmeva74Jj77djKVRf3DqrTSTRx1YU358RafBU+xv9lmnbl/GmJ
o1EtlwvYA/DK0f5UuvgXYqb/BAe4v3LJdOt2wIrRBznDqWVb/rE=
=V7bY
-----END PGP SIGNATURE-----
--sweyUxxuARB000mp--