lkml.org 
[lkml]   [2021]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 4/6] selftests: futex: Add support for 32-bit systems with 64-bit time_t
On Fri, Nov 26, 2021 at 7:00 AM Alistair Francis
<alistair.francis@opensource.wdc.com> wrote:
>
> From: Alistair Francis <alistair.francis@wdc.com>
>
> Using the new __kernel_futex_syscall*() functions let's add support for
> 32-bit systems with a 64-bit time_t. We can just direclty call the
> publically exposed __kernel_futex_syscall_timeout() and
> __kernel_futex_syscall_nr_requeue() functions to do this.
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> tools/testing/selftests/futex/functional/futex_requeue_pi.c | 2 +-
> tools/testing/selftests/futex/include/futextest.h | 5 +++--
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
> index 1ee5518ee6b7..d3673996fed4 100644
> --- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
> +++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
> @@ -294,7 +294,7 @@ int unit_test(int broadcast, long lock, int third_party_owner, long timeout_ns)
> secs = (ts.tv_nsec + timeout_ns) / 1000000000;
> ts.tv_nsec = ((int64_t)ts.tv_nsec + timeout_ns) % 1000000000;
> ts.tv_sec += secs;
> - info("ts.tv_sec = %ld\n", ts.tv_sec);
> + info("ts.tv_sec = %lld\n", ts.tv_sec);
> info("ts.tv_nsec = %ld\n", ts.tv_nsec);
> tsp = &ts;
> }

I think this causes a warning on 64-bit builds now, you have to add a
cast to 'long long'
to make it work everywhere.

Arnd

\
 
 \ /
  Last update: 2021-11-26 08:39    [W:0.385 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site