kernel: deprecate k_uptime_delta_32

The documentation motivates this function by saying it is more
efficient than the core 64-bit version.  This was untrue when
originally added, and is untrue now.  Mark the function deprecated and
replace its sole in-tree use with the trivial equivalent.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2020-03-20 08:39:31 -05:00 committed by Anas Nashif
commit 42f9d14a3f
3 changed files with 5 additions and 20 deletions

View file

@ -1957,17 +1957,16 @@ static inline s64_t k_uptime_delta(s64_t *reftime)
* This routine computes the elapsed time between the current system uptime
* and an earlier reference time, in milliseconds.
*
* This routine can be more efficient than k_uptime_delta(), as it reduces the
* need for interrupt locking and 64-bit math. However, the 32-bit result
* cannot hold an elapsed time larger than approximately 50 days, so the
* caller must handle possible rollovers.
* This is a wrapper around k_uptime_delta().
*
* @param reftime Pointer to a reference time, which is updated to the current
* uptime upon return.
*
* @return Elapsed time.
*
* @deprecated in 2.3 release, replace with k_uptime_delta()
*/
static inline u32_t k_uptime_delta_32(s64_t *reftime)
__deprecated static inline u32_t k_uptime_delta_32(s64_t *reftime)
{
return (u32_t)k_uptime_delta(reftime);
}