[tip: timers/vdso] selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
From: tip-bot2 for Thomas Weißschuh
Date: Wed Mar 11 2026 - 10:55:27 EST
The following commit has been merged into the timers/vdso branch of tip:
Commit-ID: 38bc16aa47dc89dc3753ee5359c7a7c15f7bf602
Gitweb: https://git.kernel.org/tip/38bc16aa47dc89dc3753ee5359c7a7c15f7bf602
Author: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
AuthorDate: Fri, 27 Feb 2026 07:45:59 +01:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Wed, 11 Mar 2026 15:23:11 +01:00
selftests: vDSO: vdso_test_correctness: Handle different tv_usec types
On SPARC the field tv_usec of 'struct timespec' is not a 'long int', but
only a regular int. In this case the format string is incorrect and will
trigger compiler warnings.
Avoid the warnings by casting to 'long long', similar to how it is done for
the tv_sec and what the other similar selftests are doing.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Tested-by: Andreas Larsson <andreas@xxxxxxxxxxx>
Reviewed-by: Andreas Larsson <andreas@xxxxxxxxxxx>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-4-d84830fa8beb@xxxxxxxxxxxxx
---
tools/testing/selftests/vDSO/vdso_test_correctness.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/vDSO/vdso_test_correctness.c b/tools/testing/selftests/vDSO/vdso_test_correctness.c
index 2a2d9b0..9b56488 100644
--- a/tools/testing/selftests/vDSO/vdso_test_correctness.c
+++ b/tools/testing/selftests/vDSO/vdso_test_correctness.c
@@ -404,10 +404,10 @@ static void test_gettimeofday(void)
return;
}
- printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n",
- (unsigned long long)start.tv_sec, start.tv_usec,
- (unsigned long long)vdso.tv_sec, vdso.tv_usec,
- (unsigned long long)end.tv_sec, end.tv_usec);
+ printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n",
+ (unsigned long long)start.tv_sec, (long long)start.tv_usec,
+ (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec,
+ (unsigned long long)end.tv_sec, (long long)end.tv_usec);
if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) {
printf("[FAIL]\tTimes are out of sequence\n");