Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Link: https://patch.msgid.link/20260227-vdso-selftest-cleanups-v2-4-d84830fa8beb@linutronix.de

authored by

Thomas Weißschuh and committed by
Borislav Petkov (AMD)
38bc16aa ad2af776

+4 -4
+4 -4
tools/testing/selftests/vDSO/vdso_test_correctness.c
··· 404 404 return; 405 405 } 406 406 407 - printf("\t%llu.%06ld %llu.%06ld %llu.%06ld\n", 408 - (unsigned long long)start.tv_sec, start.tv_usec, 409 - (unsigned long long)vdso.tv_sec, vdso.tv_usec, 410 - (unsigned long long)end.tv_sec, end.tv_usec); 407 + printf("\t%llu.%06lld %llu.%06lld %llu.%06lld\n", 408 + (unsigned long long)start.tv_sec, (long long)start.tv_usec, 409 + (unsigned long long)vdso.tv_sec, (long long)vdso.tv_usec, 410 + (unsigned long long)end.tv_sec, (long long)end.tv_usec); 411 411 412 412 if (!tv_leq(&start, &vdso) || !tv_leq(&vdso, &end)) { 413 413 printf("[FAIL]\tTimes are out of sequence\n");