Re: [PATCH v2] misc/nvram: only declare mutex where it's used
From: Greg Kroah-Hartman
Date: Sun May 03 2026 - 04:20:49 EST
On Sun, May 03, 2026 at 04:47:08PM +0900, Simon Richter wrote:
> The ioctls using this are platform specific compatibility code. On other
> platforms, this generates a warning for an unused static variable.
>
> Fixes: 20e07af71f34d ("powerpc: Adopt nvram module for PPC64")
> Signed-off-by: Simon Richter <Simon.Richter@xxxxxxxxxx>
> ---
> drivers/char/nvram.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
> index 9eff426a9286..34bbeba073fe 100644
> --- a/drivers/char/nvram.c
> +++ b/drivers/char/nvram.c
> @@ -53,7 +53,10 @@
> #include <asm/nvram.h>
> #endif
>
> +#if defined(CONFIG_PPC32) || defined(CONFIG_X86) || defined(CONFIG_M68K)
> static DEFINE_MUTEX(nvram_mutex);
> +#endif
> +
> static DEFINE_SPINLOCK(nvram_state_lock);
> static int nvram_open_cnt; /* #times opened */
> static int nvram_open_mode; /* special open modes */
> --
> 2.47.3
>
Why has no one ever noticed this since 2019? What changed recently to
cause this warning to show up?
thanks,
greg k-h