kernel: timer: update k_timer API for const correctness

API that takes k_timer structures but doesn't change data in them is
updated to const-qualify the underlying object, allowing information
to be retrieved from contexts where the containing object is
immutable.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2020-09-18 16:24:57 -05:00 committed by Carles Cufí
commit f1b86caff3
2 changed files with 3 additions and 3 deletions

View file

@ -2024,9 +2024,9 @@ static inline void z_impl_k_timer_user_data_set(struct k_timer *timer,
*
* @return The user data.
*/
__syscall void *k_timer_user_data_get(struct k_timer *timer);
__syscall void *k_timer_user_data_get(const struct k_timer *timer);
static inline void *z_impl_k_timer_user_data_get(struct k_timer *timer)
static inline void *z_impl_k_timer_user_data_get(const struct k_timer *timer)
{
return timer->user_data;
}