From: Simon Richter <Simon.Richter@hogyros.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>,
linux-kernel@vger.kernel.org
Cc: Simon Richter <Simon.Richter@hogyros.de>
Subject: [PATCH v2] misc/nvram: only declare mutex where it's used
Date: Sun, 3 May 2026 16:47:08 +0900 [thread overview]
Message-ID: <20260503074840.609833-1-Simon.Richter@hogyros.de> (raw)
In-Reply-To: <d1ab4056-817f-44d0-baef-32d8c280610e@hogyros.de>
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 <Simon.Richter@hogyros.de>
---
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
next prev parent reply other threads:[~2026-05-03 7:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-03 6:46 [PATCH] " Simon Richter
2026-05-03 6:53 ` Greg Kroah-Hartman
2026-05-03 7:45 ` Simon Richter
2026-05-03 7:47 ` Simon Richter [this message]
2026-05-03 8:19 ` [PATCH v2] " Greg Kroah-Hartman
2026-05-03 9:15 ` Simon Richter
2026-05-03 8:19 ` Arnd Bergmann
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=20260503074840.609833-1-Simon.Richter@hogyros.de \
--to=simon.richter@hogyros.de \
--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
all inboxes | Powered by JetHome®