]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
selftests: vDSO: vdso_config: Avoid -Wunused-variables
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Wed, 11 Jun 2025 10:33:55 +0000 (12:33 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 1 Jul 2025 13:50:42 +0000 (15:50 +0200)
Not all users of this header make use of all its variables.
For example vdso_test_correctness.c does not use "versions":

In file included from vdso_test_correctness.c:22:
vdso_config.h:61:20: warning: ‘versions’ defined but not used [-Wunused-variable]
   61 | static const char *versions[7] = {
      |                    ^~~~~~~~

Avoid those warnings through attribute((unused)).

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Link: https://lore.kernel.org/all/20250611-selftests-vdso-fixes-v3-5-e62e37a6bcf5@linutronix.de
tools/testing/selftests/vDSO/vdso_config.h

index 722260f9756198956f0dfccced907284b6851e76..5fdd0f36233742bc47ae79f23d2cfae5a0f56dee 100644 (file)
@@ -58,6 +58,7 @@
 #define VDSO_NAMES             1
 #endif
 
+__attribute__((unused))
 static const char *versions[7] = {
        "LINUX_2.6",
        "LINUX_2.6.15",
@@ -68,6 +69,7 @@ static const char *versions[7] = {
        "LINUX_5.10"
 };
 
+__attribute__((unused))
 static const char *names[2][7] = {
        {
                "__kernel_gettimeofday",