[PATCH] nvram: Conditionally define nvram_mutex

Matthew Wilcox (Oracle) posted 1 patch 7 hours ago
drivers/char/nvram.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] nvram: Conditionally define nvram_mutex
Posted by Matthew Wilcox (Oracle) 7 hours ago
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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604121134.ZzyH3ZAX-lkp@intel.com/
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