You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
timeutil: timespec: mitigate warnings when -Wtype-limits is used
Previously, warnings could be promoted to errors in timeutil.h. Those
warnings were of the form below.
warning: comparison is always true due to limited range of data type
warning: comparison is always false due to limited range of data type
Specifically, in the speed-optimized version of timespec_normalize() and
in the macro SYS_TICKS_TO_NSECS().
The speed-optimized version of timespec_normalize(), which used the
__builtin_add_overflow() function, was mainly intended to be branchless.
However, many targets generate branching instructions regardless.
The speed optimized version is less valuable in that case, so remove it.
Additionally, SYS_TICKS_TO_NSECS() does not generate the above warnings
when k_ticks_to_ns_floor64() is used instead of k_ticks_to_ns_floor32(),
so use the former.
Signed-off-by: Chris Friedt <[email protected]>
0 commit comments