Thread (2 messages) 2 messages, 2 authors, 2026-04-16

[PATCH] nvram: Conditionally define nvram_mutex

From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Date: 2026-04-14 03:39:15
Subsystem: char and misc drivers, the rest · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Linus Torvalds

This mutex is only used if compiled on one of these three architectures.
The DEFINE_MUTEX() macro used to confuse the compiler into thinking that
the mutex was used, but that was recently changed by commit 25500ba7e77c
("locking/mutex: Remove the list_head from struct mutex")

Reported-by: kernel test robot <redacted>
Closes: https://lore.kernel.org/oe-kbuild-all/202604121134.ZzyH3ZAX-lkp@intel.com/ (local)
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 drivers/char/nvram.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 9eff426a9286..cff2bd4a1fb3 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -53,7 +53,9 @@
 #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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help