* [PATCH] selftests: timers: raw_skew: initialize mon
@ 2026-11-03 23:23 Sasha Levin
2026-11-09 19:53 ` [tip: timers/core] selftests: timers: raw_skew: Initialize mon tip-bot2 for Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-11-03 23:23 UTC (permalink / raw)
To: John Stultz, Thomas Gleixner, Anna-Maria Behnsen,
Frederic Weisbecker
Cc: Stephen Boyd, Miroslav Lichvar, Shuah Khan, linux-kernel,
linux-kselftest
gcc 16 doesn't see that get_monotonic_and_raw() always sets *mon, as
the first iteration of its loop takes the diff == 0 branch, and warns
once the function is inlined into main():
raw_skew.c:46:26: warning: '*(__time_t *)((char *)&mon + offsetof(struct timespec, tv_sec))' may be used uninitialized [-Wmaybe-uninitialized]
Initialize mon to quiet it.
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Found with gcc 16.2; gcc 14 and 15 and clang 21 don't warn.
tools/testing/selftests/timers/raw_skew.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c
index dfca3e2d50d2e..ec9e5b2691c94 100644
--- a/tools/testing/selftests/timers/raw_skew.c
+++ b/tools/testing/selftests/timers/raw_skew.c
@@ -89,7 +89,7 @@ void get_monotonic_and_raw(struct timespec *mon, struct timespec *raw)
int main(int argc, char **argv)
{
- struct timespec mon, raw, start, end;
+ struct timespec mon = {}, raw, start, end;
long long delta1, delta2, interval, eppm, ppm;
long tick_nom;
struct timex tx1, tx2;
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip: timers/core] selftests: timers: raw_skew: Initialize mon
2026-11-03 23:23 [PATCH] selftests: timers: raw_skew: initialize mon Sasha Levin
@ 2026-11-09 19:53 ` tip-bot2 for Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Sasha Levin @ 2026-11-09 19:53 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Sasha Levin, Thomas Gleixner, x86, linux-kernel
The following commit has been merged into the timers/core branch of tip:
Commit-ID: c280328a7b02d751b9686156d80de4d2eea0b0a1
Gitweb: https://git.kernel.org/tip/c280328a7b02d751b9686156d80de4d2eea0b0a1
Author: Sasha Levin <sashal@kernel.org>
AuthorDate: Tue, 03 Nov 2026 18:23:06 -05:00
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Mon, 09 Nov 2026 20:21:47 +01:00
selftests: timers: raw_skew: Initialize mon
gcc 16 doesn't see that get_monotonic_and_raw() always sets *mon, as
the first iteration of its loop takes the diff == 0 branch, and warns
once the function is inlined into main():
raw_skew.c:46:26: warning: '*(__time_t *)((char *)&mon + offsetof(struct timespec, tv_sec))' may be used uninitialized [-Wmaybe-uninitialized]
Initialize mon to quiet it.
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20261103232307.1924618-2-sashal@kernel.org
---
tools/testing/selftests/timers/raw_skew.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/timers/raw_skew.c b/tools/testing/selftests/timers/raw_skew.c
index a61f6a0..5f43b03 100644
--- a/tools/testing/selftests/timers/raw_skew.c
+++ b/tools/testing/selftests/timers/raw_skew.c
@@ -91,7 +91,7 @@ void get_monotonic_and_raw(struct timespec *mon, struct timespec *raw)
int main(int argc, char **argv)
{
- struct timespec mon, raw, start, end;
+ struct timespec mon = {}, raw, start, end;
long long delta1, delta2, interval, eppm, ppm;
long tick_nom;
struct timex tx1, tx2;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-09 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03 23:23 [PATCH] selftests: timers: raw_skew: initialize mon Sasha Levin
2026-11-09 19:53 ` [tip: timers/core] selftests: timers: raw_skew: Initialize mon tip-bot2 for Sasha Levin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.