From 9ab0c1b183aa925da53a711949b8bcd183906390 Mon Sep 17 00:00:00 2001 From: Tim Pambor Date: Tue, 10 Jun 2025 12:37:52 +0200 Subject: [PATCH] sys: timeutil: Fix warning in timespec_is_valid Cast NSEC_PER_SEC to long to resolve a compiler warning about comparison between signed and unsigned integer expression. Signed-off-by: Tim Pambor --- include/zephyr/sys/timeutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/sys/timeutil.h b/include/zephyr/sys/timeutil.h index 3da7ccdd733..7c5db054f36 100644 --- a/include/zephyr/sys/timeutil.h +++ b/include/zephyr/sys/timeutil.h @@ -338,7 +338,7 @@ static inline bool timespec_is_valid(const struct timespec *ts) { __ASSERT_NO_MSG(ts != NULL); - return (ts->tv_nsec >= 0) && (ts->tv_nsec < NSEC_PER_SEC); + return (ts->tv_nsec >= 0) && (ts->tv_nsec < (long)NSEC_PER_SEC); } /**