Thread (7 messages) 7 messages, 3 authors, 20d ago

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

From: Simon Richter <hidden>
Date: 2026-05-03 07:49:32
Subsystem: char and misc drivers, the rest · Maintainers: Arnd Bergmann, Greg Kroah-Hartman, Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help