[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260115-vdso-selftest-cleanups-v1-4-103e1ccbfdc3@linutronix.de>
Date: Thu, 15 Jan 2026 09:29:56 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...nel.org>,
Vincenzo Frascino <vincenzo.frascino@....com>,
Shuah Khan <shuah@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Andreas Larsson <andreas@...sler.com>
Subject: [PATCH 4/6] 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@...utronix.de>
Tested-by: Andreas Larsson <andreas@...sler.com>
Reviewed-by: Andreas Larsson <andreas@...sler.com>
---
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 2a2d9b01a938..9b564888e74d 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");
--
2.52.0
Powered by blists - more mailing lists