Commit 7ae04ead authored by John Stultz's avatar John Stultz Committed by Greg Kroah-Hartman
Browse files

UPSTREAM: selftests: timers: Fix abs() warning in posix_timers test



commit ed366de8 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: 0bc4b0cf ("selftests: add basic posix timers selftests")
Change-Id: I18359f027ed56a0bcfeabfa4e8145d4d08ee7a7d
Signed-off-by: default avatarJohn Stultz <jstultz@google.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20240410232637.4135564-3-jstultz@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 5c5fb505)
Signed-off-by: default avatarEdward Liaw <edliaw@google.com>
parent 32d9c563
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment