mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] selftests/futex: print tv_sec as long long
@ 2026-11-03 15:54 Sasha Levin
  2026-11-09 19:28 ` André Almeida
  2026-11-30 21:06 ` [tip: locking/futex] selftests/futex: Print " tip-bot2 for Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2026-11-03 15:54 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar
  Cc: Peter Zijlstra, Darren Hart, Davidlohr Bueso, André Almeida,
	Shuah Khan, linux-kernel, linux-kselftest

On 32-bit architectures with a 64-bit time_t, such as armhf in Debian
13, tv_sec is a long long, and printing it with %ld warns:

  futex_requeue_pi.c:351:30: warning: format specifies type 'long' but the argument has type '__time64_t' (aka 'long long') [-Wformat]

Cast it to long long and print it with %lld.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Found with a 32-bit build of the selftests with a 64-bit time_t (gcc 16
and clang 21 with -m32 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64);
KernelCI's 32-bit arm builds show the same warnings. The changed files
build without format warnings there now, and the x86_64 builds don't
change. The other selftests get the same kind of fix in separate
patches.

 tools/testing/selftests/futex/functional/futex_requeue_pi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
index 65326cbef3a44..2530e6999f933 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
@@ -348,7 +348,7 @@ TEST_F(args, futex_requeue_pi)
 		secs = (ts.tv_nsec + timeout_ns) / 1000000000;
 		ts.tv_nsec = ((int64_t)ts.tv_nsec + timeout_ns) % 1000000000;
 		ts.tv_sec += secs;
-		TH_LOG("ts.tv_sec  = %ld", ts.tv_sec);
+		TH_LOG("ts.tv_sec  = %lld", (long long)ts.tv_sec);
 		TH_LOG("ts.tv_nsec = %ld", ts.tv_nsec);
 		tsp = &ts;
 	}
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selftests/futex: print tv_sec as long long
  2026-11-03 15:54 [PATCH] selftests/futex: print tv_sec as long long Sasha Levin
@ 2026-11-09 19:28 ` André Almeida
  2026-11-30 21:06 ` [tip: locking/futex] selftests/futex: Print " tip-bot2 for Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: André Almeida @ 2026-11-09 19:28 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Peter Zijlstra, Thomas Gleixner, Darren Hart, Davidlohr Bueso,
	Ingo Molnar, Shuah Khan, linux-kernel, linux-kselftest

Em 03/11/2026 12:54, Sasha Levin escreveu:
> On 32-bit architectures with a 64-bit time_t, such as armhf in Debian
> 13, tv_sec is a long long, and printing it with %ld warns:
> 
>    futex_requeue_pi.c:351:30: warning: format specifies type 'long' but the argument has type '__time64_t' (aka 'long long') [-Wformat]
> 
> Cast it to long long and print it with %lld.
> 
> Signed-off-by: Sasha Levin <sashal@kernel.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip: locking/futex] selftests/futex: Print tv_sec as long long
  2026-11-03 15:54 [PATCH] selftests/futex: print tv_sec as long long Sasha Levin
  2026-11-09 19:28 ` André Almeida
@ 2026-11-30 21:06 ` tip-bot2 for Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Sasha Levin @ 2026-11-30 21:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Sasha Levin, Thomas Gleixner, andrealmeid, x86, linux-kernel

The following commit has been merged into the locking/futex branch of tip:

Commit-ID:     e2f325bc7f1e22fdd84a281fb600ee33e61724fd
Gitweb:        https://git.kernel.org/tip/e2f325bc7f1e22fdd84a281fb600ee33e61724fd
Author:        Sasha Levin <sashal@kernel.org>
AuthorDate:    Tue, 03 Nov 2026 10:54:45 -05:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Mon, 30 Nov 2026 22:03:34 +01:00

selftests/futex: Print tv_sec as long long

On 32-bit architectures with a 64-bit time_t, such as armhf in Debian
13, tv_sec is a long long, and printing it with %ld warns:

  futex_requeue_pi.c:351:30: warning: format specifies type 'long' but the argument has type '__time64_t' (aka 'long long') [-Wformat]

Cast it to long long and print it with %lld.

Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Link: https://patch.msgid.link/20261103155445.534229-1-sashal@kernel.org
---
 tools/testing/selftests/futex/functional/futex_requeue_pi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/futex/functional/futex_requeue_pi.c b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
index 65326cb..2530e69 100644
--- a/tools/testing/selftests/futex/functional/futex_requeue_pi.c
+++ b/tools/testing/selftests/futex/functional/futex_requeue_pi.c
@@ -348,7 +348,7 @@ TEST_F(args, futex_requeue_pi)
 		secs = (ts.tv_nsec + timeout_ns) / 1000000000;
 		ts.tv_nsec = ((int64_t)ts.tv_nsec + timeout_ns) % 1000000000;
 		ts.tv_sec += secs;
-		TH_LOG("ts.tv_sec  = %ld", ts.tv_sec);
+		TH_LOG("ts.tv_sec  = %lld", (long long)ts.tv_sec);
 		TH_LOG("ts.tv_nsec = %ld", ts.tv_nsec);
 		tsp = &ts;
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-30 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 15:54 [PATCH] selftests/futex: print tv_sec as long long Sasha Levin
2026-11-09 19:28 ` André Almeida
2026-11-30 21:06 ` [tip: locking/futex] selftests/futex: Print " tip-bot2 for Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®