]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
modpost: Declare extra_warn with unused attribute
authorNathan Chancellor <nathan@kernel.org>
Thu, 26 Mar 2026 01:20:30 +0000 (18:20 -0700)
committerNathan Chancellor <nathan@kernel.org>
Mon, 30 Mar 2026 05:45:34 +0000 (07:45 +0200)
commitdeb4605671cfae3b2803cfbbf4739e7245248398
treea284643b16d1f76f7958f517031cffcc27c84681
parent742de64b62b690a368dbeb846499eb8ac8ceedb9
modpost: Declare extra_warn with unused attribute

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()")
Link: https://patch.msgid.link/20260325-modpost-extra_warn-unused-but-set-global-v1-1-2e84003b7e81@kernel.org
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
scripts/mod/modpost.c