linux/tools/testing/selftests/timers
John Stultz 881b495ed2 selftests: timers: Fix abs() warning in posix_timers test
commit ed366de8ec upstream.

Building with clang results in the following warning:

  posix_timers.c:69:6: warning: absolute value function 'abs' given an
      argument of type 'long long' but has parameter of type 'int' which may
      cause truncation of value [-Wabsolute-value]
        if (abs(diff - DELAY * USECS_PER_SEC) > USECS_PER_SEC / 2) {
            ^
So switch to using llabs() instead.

Fixes: 0bc4b0cf15 ("selftests: add basic posix timers selftests")
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240410232637.4135564-3-jstultz@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-04-17 11:18:28 +02:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
adjtick.c selftests: timers: fix declarations of main() 2022-07-14 14:36:07 -06:00
alarmtimer-suspend.c selftests:timers: globals don't need initialization to 0 2022-07-03 13:26:45 -06:00
change_skew.c selftests: timers: fix declarations of main() 2022-07-14 14:36:07 -06:00
clocksource-switch.c selftests: timers: clocksource-switch: adapt to kselftest framework 2022-07-14 14:36:52 -06:00
freq-step.c kselftests: timers: freq-step: Update maximum acceptable precision and errors 2019-06-22 11:28:53 +02:00
inconsistency-check.c selftests: timers: inconsistency-check: adapt to kselftest framework 2022-07-14 14:36:18 -06:00
leap-a-day.c timekeeping, clocksource: Fix various typos in comments 2021-03-22 23:06:48 +01:00
leapcrash.c timekeeping, clocksource: Fix various typos in comments 2021-03-22 23:06:48 +01:00
Makefile selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
mqueue-lat.c selftests/timers: Add missing fflush(stdout) calls 2019-05-21 09:24:31 -06:00
nanosleep.c selftests: timers: nanosleep: adapt to kselftest framework 2022-07-14 14:36:13 -06:00
nsleep-lat.c selftests/timers: Add missing fflush(stdout) calls 2019-05-21 09:24:31 -06:00
posix_timers.c selftests: timers: Fix abs() warning in posix_timers test 2024-04-17 11:18:28 +02:00
raw_skew.c selftests: timers: fix declarations of main() 2022-07-14 14:36:07 -06:00
rtcpie.c selftests: timers: rtcpie: skip test if default RTC device does not exist 2021-06-07 19:18:52 -06:00
set-2038.c selftests: timers: drop support for !KTEST case 2017-08-22 11:15:59 -06:00
set-tai.c selftests/timers: Add missing fflush(stdout) calls 2019-05-21 09:24:31 -06:00
set-timer-lat.c selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms 2017-09-25 10:09:07 -06:00
set-tz.c selftests/timers: Add missing fflush(stdout) calls 2019-05-21 09:24:31 -06:00
settings selftests/timers: Turn off timeout setting 2020-08-20 15:49:28 -06:00
skew_consistency.c selftests: timers: fix declarations of main() 2022-07-14 14:36:07 -06:00
threadtest.c timekeeping, clocksource: Fix various typos in comments 2021-03-22 23:06:48 +01:00
valid-adjtimex.c selftests: timers: valid-adjtimex: build fix for newer toolchains 2022-07-14 14:36:00 -06:00