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 <[email protected]>
---
 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


Reply via email to