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); } /**