Skip to contentSkip to conversation

nvram: Conditionally define nvram_mutex

PATCH In review Matthew Wilcox (Oracle) 2 participants 2 messages Apr 14 – Apr 16 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvram: Conditionally define nvram_mutex

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")

---
 drivers/char/nvram.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/char/nvram.c +2 -0
index 9eff426a9286..cff2bd4a1fb3 100644
@@ -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 */
Signature · 1 line
2.47.3
#1 lore raw

Hi Willy,

Quoted 8 lines · Matthew Wilcox (Oracle)

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")

Thanks for your patch!

drivers/char/nvram.c line 61

Quoted 13 lines
drivers/char/nvram.c +2 -0
@@ -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 */

This is being removed for good in "[PATCH v4] char/nvram: Remove redundant nvram_mutex"
https://lore.kernel.org/all/[email protected]

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds