Skip to contentSkip to conversation

nvram: Only define nvram_mutex where it is used

PATCH In review Mukesh Kumar Chaurasiya (IBM) 2 participants 2 messages May 25 – May 27 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvram: Only define nvram_mutex where it is used

nvram_mutex is currently defined unconditionally, but is only used on x86, ppc32 and m68k. This causes an unused symbol warning on other architectures.

Restrict the mutex definition to the architectures that actually require it and avoid generating unnecessary warnings on the remaining platforms.

---
 drivers/char/nvram.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/char/nvram.c +3 -0
index 9eff426a9286..72ddb225a2ba 100644
@@ -53,7 +53,10 @@
 #include <asm/nvram.h>
 #endif
 
+#if IS_ENABLED(CONFIG_PPC32) || IS_ENABLED(CONFIG_X86) || IS_ENABLED(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.54.0
#1 lore raw

Hi Mukesh,

Quoted 8 lines · Mukesh Kumar Chaurasiya (IBM)

nvram_mutex is currently defined unconditionally, but is only used on x86, ppc32 and m68k. This causes an unused symbol warning on other architectures.

Restrict the mutex definition to the architectures that actually require it and avoid generating unnecessary warnings on the remaining platforms.

Thanks for your patch!

This seems to need more coordination in and outside IBM?

[PATCH v5] char/nvram: Remove redundant nvram_mutex
https://lore.kernel.org/all/[email protected]/

Gr{oetje,eeting}s,

Geert

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