From: Greg KH <gregkh@linuxfoundation.org>
To: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
linux-kbuild@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
nathan@kernel.org, nsc@kernel.org, ojeda@kernel.org,
masahiroy@kernel.org, linux@weissschuh.net, tamird@kernel.org,
rostedt@goodmis.org, ihor.solodrai@linux.dev,
ritesh.list@gmail.com, maddy@linux.ibm.com, peterz@infradead.org
Subject: Re: [PATCH] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning
Date: Mon, 23 Mar 2026 08:36:14 +0100 [thread overview]
Message-ID: <2026032350-stardust-unselfish-ad61@gregkh> (raw)
In-Reply-To: <20260323072422.25730-1-venkat88@linux.ibm.com>
On Mon, Mar 23, 2026 at 12:54:22PM +0530, Venkat Rao Bagalkote wrote:
> drivers/char/nvram.c defines a static mutex 'nvram_mutex' which is never
> used. This results in a compiler warning on linux-next builds:
>
> warning: 'nvram_mutex' defined but not used [-Wunused-variable]
>
> Remove the unused definition to avoid the warning.
>
> Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> ---
> drivers/char/nvram.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
> index 9eff426a9286..2ce3307663ed 100644
> --- a/drivers/char/nvram.c
> +++ b/drivers/char/nvram.c
> @@ -53,7 +53,7 @@
> #include <asm/nvram.h>
> #endif
>
> -static DEFINE_MUTEX(nvram_mutex);
> +static __maybe_unused DEFINE_MUTEX(nvram_mutex);
If it is never used, why not actually delete it? This just papers over
the real issue :(
thanks,
greg k-h
next prev parent reply other threads:[~2026-03-23 7:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 7:24 [PATCH] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning Venkat Rao Bagalkote
2026-03-23 7:35 ` Venkat Rao Bagalkote
2026-03-23 7:36 ` Greg KH [this message]
2026-03-23 7:59 ` 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=2026032350-stardust-unselfish-ad61@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=ihor.solodrai@linux.dev \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=peterz@infradead.org \
--cc=ritesh.list@gmail.com \
--cc=rostedt@goodmis.org \
--cc=tamird@kernel.org \
--cc=venkat88@linux.ibm.com \
/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