summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2026-08-31 18:46:31 -0700
committerNicolas Schier <nsc@kernel.org>2026-09-12 20:01:18 +0200
commit4f73462856576797b8f3c55564a9be99f76dc67b (patch)
tree80c7ed0413854f2f54c1be274c2d19a59be96cce
parent06bb43d8c79762fa3452f292cd080e54bef5d431 (diff)
downloadlinux-4f73462856576797b8f3c55564a9be99f76dc67b.tar.gz
linux-4f73462856576797b8f3c55564a9be99f76dc67b.zip
scripts/sorttable: Mark long_size as __maybe_unused
When building in a kernel tree prior to commit b055f4c431e3 ("sorttable: Move ELF parsing into scripts/elf-parse.[ch]") with clang-23 or newer, which implements a new warning under -Wunused-but-set-variable for static global variable, there is a warning from sorttable because long_size is unused when MCOUNT_SORT_ENABLED is not set: scripts/sorttable.c:452:12: error: variable 'long_size' set but not used [-Werror,-Wunused-but-set-global] 452 | static int long_size; | ^ Mark long_size as __maybe_unused to avoid inserting more ugly #ifdef directives while insuring the warning does not reappear, as the aforementioned change does not alter the uses of long_size, so it appears to be coincidence that the warning disappears after this refactoring. Cc: stable@vger.kernel.org Signed-off-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Nicolas Schier <n.schier@fritz.com> Link: https://patch.msgid.link/20260831-sorttable-long_size-unused-but-set-global-v1-1-8a96b88697e5@kernel.org Signed-off-by: Nicolas Schier <nsc@kernel.org>
-rw-r--r--scripts/sorttable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/sorttable.c b/scripts/sorttable.c
index d8dc2a1b7c31..d7b50581c732 100644
--- a/scripts/sorttable.c
+++ b/scripts/sorttable.c
@@ -116,7 +116,7 @@ static inline void *get_index(void *start, int entsize, int index)
}
static int extable_ent_size;
-static int long_size;
+static int long_size __maybe_unused;
#define ERRSTR_MAXSZ 256