Re: [PATCH 06/10] [RESEND] lockdep: change 'static const' variables to enum values
From: Andy Shevchenko
Date: Fri May 02 2025 - 10:03:06 EST
On Wed, Apr 09, 2025 at 02:22:58PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> gcc warns about 'static const' variables even in headers when building
> with -Wunused-const-variables enabled:
>
> In file included from kernel/locking/lockdep_proc.c:25:
> kernel/locking/lockdep_internals.h:69:28: error: 'LOCKF_USED_IN_IRQ_READ' defined but not used [-Werror=unused-const-variable=]
> 69 | static const unsigned long LOCKF_USED_IN_IRQ_READ =
> | ^~~~~~~~~~~~~~~~~~~~~~
> kernel/locking/lockdep_internals.h:63:28: error: 'LOCKF_ENABLED_IRQ_READ' defined but not used [-Werror=unused-const-variable=]
> 63 | static const unsigned long LOCKF_ENABLED_IRQ_READ =
> | ^~~~~~~~~~~~~~~~~~~~~~
> kernel/locking/lockdep_internals.h:57:28: error: 'LOCKF_USED_IN_IRQ' defined but not used [-Werror=unused-const-variable=]
> 57 | static const unsigned long LOCKF_USED_IN_IRQ =
> | ^~~~~~~~~~~~~~~~~
> kernel/locking/lockdep_internals.h:51:28: error: 'LOCKF_ENABLED_IRQ' defined but not used [-Werror=unused-const-variable=]
> 51 | static const unsigned long LOCKF_ENABLED_IRQ =
> | ^~~~~~~~~~~~~~~~~
>
> This one is easy to avoid by changing the generated constant definition
> into an equivalent enum.
Any news here, please? The problem still exists in v6.15-rc4.
--
With Best Regards,
Andy Shevchenko