From: Nathan Chancellor <nathan@kernel.org>
To: Nicolas Schier <nsc@kernel.org>
Cc: Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Jeff Johnson <jeff.johnson@oss.qualcomm.com>,
Masahiro Yamada <masahiroy@kernel.org>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH] modpost: Declare extra_warn with unused attribute
Date: Thu, 2 Apr 2026 00:03:25 +0100 [thread overview]
Message-ID: <20260401230325.GA1076298@ax162> (raw)
In-Reply-To: <acwisFwJ3eMMQLIp@levanger>
On Tue, Mar 31, 2026 at 09:38:24PM +0200, Nicolas Schier wrote:
> On Wed, Mar 25, 2026 at 06:20:30PM -0700, Nathan Chancellor wrote:
> > A recent strengthening of -Wunused-but-set-variable (enabled with -Wall)
> > in clang under a new subwarning, -Wunused-but-set-global, points out an
> > unused static global variable in scripts/mod/modpost.c:
> >
> > scripts/mod/modpost.c:59:13: error: variable 'extra_warn' set but not used [-Werror,-Wunused-but-set-global]
> > 59 | static bool extra_warn;
> > | ^
> >
> > This variable has been unused since commit 6c6c1fc09de3 ("modpost:
> > require a MODULE_DESCRIPTION()") but that is expected, as there are
> > currently no extra warnings at W=1 right now. Declare the variable with
> > the unused attribute to make it clear to the compiler that this variable
> > may be unused.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 6c6c1fc09de3 ("modpost: require a MODULE_DESCRIPTION()")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > ---
> > I will apply this to kbuild-fixes for 7.0.
> > ---
> > scripts/mod/modpost.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> modpost is just used in-tree, right? Can't we just remove the '-W' flag
> and the extra_warn variable completely?
We could but I figured it was worth keeping it around in case we grow
any other checks that we would want under W=1. Not sure what those would
be but the dead code here is minimal so it did not seem worth it to
clean it up just for this warning.
> Nevertheless,
>
> Reviewed-by: Nicolas Schier <nsc@kernel.org>
Thanks!
Nathan
next prev parent reply other threads:[~2026-04-01 23:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 1:20 [PATCH] modpost: Declare extra_warn with unused attribute Nathan Chancellor
2026-03-31 19:38 ` Nicolas Schier
2026-04-01 23:03 ` Nathan Chancellor [this message]
2026-04-01 23:04 ` (subset) " Nathan Chancellor
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=20260401230325.GA1076298@ax162 \
--to=nathan@kernel.org \
--cc=jeff.johnson@oss.qualcomm.com \
--cc=justinstitt@google.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=masahiroy@kernel.org \
--cc=morbo@google.com \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nsc@kernel.org \
--cc=stable@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