Skip to content

Commit deb4605

Browse files
committed
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 6c6c1fc ("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: [email protected] Fixes: 6c6c1fc ("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 <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 742de64 commit deb4605

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/mod/modpost.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static bool allow_missing_ns_imports;
5656

5757
static bool error_occurred;
5858

59-
static bool extra_warn;
59+
static bool extra_warn __attribute__((unused));
6060

6161
bool target_is_big_endian;
6262
bool host_is_big_endian;

0 commit comments

Comments
 (0)