Re: [PATCH v2] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning

From: Arnd Bergmann

Date: Mon Mar 23 2026 - 15:00:58 EST


On Mon, Mar 23, 2026, at 11:14, Christophe Leroy (CS GROUP) wrote:
> Le 23/03/2026 à 08:32, Venkat Rao Bagalkote a écrit :
> diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
> index 9eff426a9286..2fd744bf9093 100644
> --- a/drivers/char/nvram.c
> +++ b/drivers/char/nvram.c
> @@ -308,8 +308,10 @@ static long nvram_misc_ioctl(struct file *file,
> unsigned int cmd,
> }
> #endif
> break;
> -#ifdef CONFIG_PPC32
> case IOC_NVRAM_SYNC:
> + if (IS_ENABLED(CONFIG_PPC64))
> + break;
> +
> if (ppc_md.nvram_sync != NULL) {
> mutex_lock(&nvram_mutex);
> ppc_md.nvram_sync();

Right, this works as well, though I still like the idea better
of removing the mutex and all its callers, leaving the locking
to be done inside of the individual operations, as they all
do.

Arnd