mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86
@ 2026-10-11 22:33 Sasha Levin
  2026-10-12  2:17 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-10-11 22:33 UTC (permalink / raw)
  To: Shuah Khan, Alexey Dobriyan, Andrew Morton
  Cc: Sasha Levin, linux-kernel, linux-fsdevel, linux-kselftest

g_vsyscall is only used by the x86_64 test, so other architectures get:

  proc-pid-vm.c:224:21: warning: unused variable 'g_vsyscall' [-Wunused-variable]

Mark it __maybe_unused, like str_vsyscall next to it.

Fixes: 17415606f9d8b ("tools/testing/selftests/proc/proc-pid-vm.c: test with vsyscall in mind")
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/proc/proc-pid-vm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/proc/proc-pid-vm.c b/tools/testing/selftests/proc/proc-pid-vm.c
index 4e6a3e53f9757..c5a66f481ab4d 100644
--- a/tools/testing/selftests/proc/proc-pid-vm.c
+++ b/tools/testing/selftests/proc/proc-pid-vm.c
@@ -221,7 +221,7 @@ static int make_exe(const uint8_t *payload, size_t len)
  * 1: vsyscall VMA is --xp		vsyscall=xonly
  * 2: vsyscall VMA is r-xp		vsyscall=emulate
  */
-static volatile int g_vsyscall;
+static volatile int g_vsyscall __maybe_unused;
 static const char *str_vsyscall __maybe_unused;
 
 static const char str_vsyscall_0[] __maybe_unused = "";
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-12  2:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-11 22:33 [PATCH] selftests/proc: proc-pid-vm: fix unused variable warning on non-x86 Sasha Levin
2026-10-12  2:17 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®