Re: [PATCH v2] misc/nvram: only declare mutex where it's used

From: Simon Richter

Date: Sun May 03 2026 - 05:15:41 EST


Hi,

On 5/3/26 17:19, Greg Kroah-Hartman wrote:

Why has no one ever noticed this since 2019? What changed recently to
cause this warning to show up?

- CONFIG_NVRAM depends on X86 || HAVE_ARCH_NVRAM_OPS
- HAVE_ARCH_NVRAM_OPS is set only on PPC and M68K

so nvram.c is compiled only with CONFIG_X86 || CONFIG_PPC || CONFIG_M68K

- ppc32 and m68k actually use the mutex

so it shows up only on PPC64 if you build with CONFIG_NVRAM, and is only an error if you also build with CONFIG_WERROR as well.

The warning on ppc64 in introduced in 20e07af71f34d, so 95ac14b8a3281 does not need a fix as the mutex is actually used in all configurations where the driver can be enabled.

It's also debatable if the Kconfig is optimal -- HAVE_ARCH_NVRAM_OPS is defined in arch/ and used only in this one place, so either x86 should set it as well, or it's removed and CONFIG_NVRAM gets an explicit architecture list.

Simon

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature