From: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
To: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Cc: "Mukesh Kumar Chaurasiya (IBM)" <mkchauras@gmail.com>
Subject: [PATCH] nvram: Only define nvram_mutex where it is used
Date: Mon, 25 May 2026 13:33:43 +0530 [thread overview]
Message-ID: <20260525080343.143957-1-mkchauras@gmail.com> (raw)
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.
Signed-off-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
---
drivers/char/nvram.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
index 9eff426a9286..72ddb225a2ba 100644
--- a/drivers/char/nvram.c
+++ b/drivers/char/nvram.c
@@ -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 */
--
2.54.0
next reply other threads:[~2026-05-25 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-25 8:03 Mukesh Kumar Chaurasiya (IBM) [this message]
2026-05-27 13:30 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260525080343.143957-1-mkchauras@gmail.com \
--to=mkchauras@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome