From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
linux-kernel@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
maddy@linux.ibm.com, arnd@arndb.de, chleroy@kernel.org,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Subject: Re: [PATCH v3] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning
Date: Mon, 30 Mar 2026 12:12:28 +0530 [thread overview]
Message-ID: <se9hn7hn.ritesh.list@gmail.com> (raw)
In-Reply-To: <20260330062201.2581-1-venkat88@linux.ibm.com>
Venkat Rao Bagalkote <venkat88@linux.ibm.com> writes:
> 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.
>
That is not the only reason for removing the nvram_mutex. I think we
discussed in detail, why we think this can be removed here [1].
We should add those details in commit msg too.
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
> Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
> ---
> v3:
> - Removed global nvram_mutex entirely
We only removed the mutex definition and not the usage right. This does
not look correct. Maybe you can check sashiko review comments for
details -
https://sashiko.dev/#/patchset/20260330062201.2581-1-venkat88%40linux.ibm.com
-ritesh
>
> drivers/char/nvram.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/char/nvram.c b/drivers/char/nvram.c
> index 9eff426a9286..9ab2744cd375 100644
> --- a/drivers/char/nvram.c
> +++ b/drivers/char/nvram.c
> @@ -53,7 +53,6 @@
> #include <asm/nvram.h>
> #endif
>
> -static DEFINE_MUTEX(nvram_mutex);
> static DEFINE_SPINLOCK(nvram_state_lock);
> static int nvram_open_cnt; /* #times opened */
> static int nvram_open_mode; /* special open modes */
> --
> 2.45.2
next prev parent reply other threads:[~2026-03-30 6:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-30 6:22 [PATCH v3] char: nvram: Remove unused nvram_mutex to fix -Wunused-variable warning Venkat Rao Bagalkote
2026-03-30 6:42 ` Ritesh Harjani [this message]
2026-04-02 20:04 ` kernel test robot
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=se9hn7hn.ritesh.list@gmail.com \
--to=ritesh.list@gmail.com \
--cc=arnd@arndb.de \
--cc=chleroy@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.