]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests: vDSO: vdso_test_getrandom: Avoid -Wunused
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Wed, 11 Jun 2025 10:33:54 +0000 (12:33 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 1 Jul 2025 13:50:42 +0000 (15:50 +0200)
vgetrandom_put_state() and the variable "ret" in kselftest() are unused.

Drop the variable "ret". Suppress the warning for  vgetrandom_put_state()
as it is meant as an example for libc implementors.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20250611-selftests-vdso-fixes-v3-4-e62e37a6bcf5@linutronix.de
tools/testing/selftests/vDSO/vdso_test_getrandom.c

index f36e50f372f935e6d4da3175c81e210653bdce1d..389ead4e1fe3761f265f7b589b417b6d9f25c565 100644 (file)
@@ -100,6 +100,7 @@ out:
        return state;
 }
 
+__attribute__((unused)) /* Example for libc implementors */
 static void vgetrandom_put_state(void *state)
 {
        if (!state)
@@ -264,7 +265,7 @@ static void kselftest(void)
        }
        for (;;) {
                struct ptrace_syscall_info info = { 0 };
-               int status, ret;
+               int status;
                ksft_assert(waitpid(child, &status, 0) >= 0);
                if (WIFEXITED(status)) {
                        ksft_assert(WEXITSTATUS(status) == 0);