diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-15 14:51:50 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-15 14:51:50 +0200 |
commit | 8e4aacb97ced344ec71f065f86211f6ccd48bdfd (patch) | |
tree | e8f4cc279d92c45dd1937f85cee665193ebd1328 /queue-5.4 | |
parent | a3c1a5403a6f2dbacafeebaddb088f0c98917356 (diff) | |
download | stable-queue-8e4aacb97ced344ec71f065f86211f6ccd48bdfd.tar.gz |
5.4-stable patches
added patches:
selftests-timers-fix-abs-warning-in-posix_timers-test.patch
Diffstat (limited to 'queue-5.4')
-rw-r--r-- | queue-5.4/selftests-timers-fix-abs-warning-in-posix_timers-test.patch | 39 | ||||
-rw-r--r-- | queue-5.4/series | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/queue-5.4/selftests-timers-fix-abs-warning-in-posix_timers-test.patch b/queue-5.4/selftests-timers-fix-abs-warning-in-posix_timers-test.patch new file mode 100644 index 0000000000..2a26a8d799 --- /dev/null +++ b/queue-5.4/selftests-timers-fix-abs-warning-in-posix_timers-test.patch @@ -0,0 +1,39 @@ +From ed366de8ec89d4f960d66c85fc37d9de22f7bf6d Mon Sep 17 00:00:00 2001 +From: John Stultz <jstultz@google.com> +Date: Wed, 10 Apr 2024 16:26:30 -0700 +Subject: selftests: timers: Fix abs() warning in posix_timers test + +From: John Stultz <jstultz@google.com> + +commit ed366de8ec89d4f960d66c85fc37d9de22f7bf6d 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: 0bc4b0cf1570 ("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> +--- + tools/testing/selftests/timers/posix_timers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/tools/testing/selftests/timers/posix_timers.c ++++ b/tools/testing/selftests/timers/posix_timers.c +@@ -66,7 +66,7 @@ static int check_diff(struct timeval sta + diff = end.tv_usec - start.tv_usec; + diff += (end.tv_sec - start.tv_sec) * USECS_PER_SEC; + +- if (abs(diff - DELAY * USECS_PER_SEC) > USECS_PER_SEC / 2) { ++ if (llabs(diff - DELAY * USECS_PER_SEC) > USECS_PER_SEC / 2) { + printf("Diff too high: %lld..", diff); + return -1; + } diff --git a/queue-5.4/series b/queue-5.4/series index 409acfe6e1..4464e1f1b9 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -18,3 +18,4 @@ net-ena-fix-potential-sign-extension-issue.patch btrfs-qgroup-correctly-model-root-qgroup-rsv-in-convert.patch drm-client-fully-protect-modes-with-dev-mode_config.mutex.patch vhost-add-smp_rmb-in-vhost_vq_avail_empty.patch +selftests-timers-fix-abs-warning-in-posix_timers-test.patch |