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 <tim.pambor@codewrights.de>
This commit is contained in:
Tim Pambor 2025-06-10 12:37:52 +02:00 committed by Anas Nashif
commit 9ab0c1b183

View file

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