[PATCH] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning
Venkat Rao Bagalkote
venkat88 at linux.ibm.com
Mon Mar 23 18:35:12 AEDT 2026
Please ignore this. Sent v2 [1]
[1]:
https://lore.kernel.org/all/20260323073220.25798-1-venkat88@linux.ibm.com/
Regards,
Venkat.
On 23/03/26 12:54 pm, Venkat Rao Bagalkote wrote:
> drivers/char/nvram.c defines a static mutex 'nvram_mutex' which is never
> used. This results in a compiler warning on linux-next builds:
>
> warning: 'nvram_mutex' defined but not used [-Wunused-variable]
>
> Remove the unused definition to avoid the warning.
>
> Signed-off-by: Venkat Rao Bagalkote <venkat88 at linux.ibm.com>
> ---
> drivers/char/nvram.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
> index 9eff426a9286..2ce3307663ed 100644
> --- a/drivers/char/nvram.c
> +++ b/drivers/char/nvram.c
> @@ -53,7 +53,7 @@
> #include <asm/nvram.h>
> #endif
>
> -static DEFINE_MUTEX(nvram_mutex);
> +static __maybe_unused DEFINE_MUTEX(nvram_mutex);
> static DEFINE_SPINLOCK(nvram_state_lock);
> static int nvram_open_cnt; /* #times opened */
> static int nvram_open_mode; /* special open modes */
More information about the Linuxppc-dev
mailing list