diff --git a/include/kernel.h b/include/kernel.h index 40ac0d59e5b..6f497ae46de 100644 --- a/include/kernel.h +++ b/include/kernel.h @@ -1331,7 +1331,6 @@ struct k_timer { #define _K_TIMER_INITIALIZER(obj, expiry, stop) \ { \ .timeout.delta_ticks_from_prev = _INACTIVE, \ - .timeout.wait_q = NULL, \ .timeout.thread = NULL, \ .timeout.func = _timer_expiration_handler, \ .wait_q = _WAIT_Q_INIT(&obj.wait_q), \ diff --git a/include/sys_clock.h b/include/sys_clock.h index 2fe25014158..b9a5049362a 100644 --- a/include/sys_clock.h +++ b/include/sys_clock.h @@ -216,7 +216,6 @@ typedef void (*_timeout_func_t)(struct _timeout *t); struct _timeout { sys_dnode_t node; struct k_thread *thread; - sys_dlist_t *wait_q; s32_t delta_ticks_from_prev; _timeout_func_t func; }; diff --git a/kernel/sys_clock.c b/kernel/sys_clock.c index 7473aef853c..632ff098401 100644 --- a/kernel/sys_clock.c +++ b/kernel/sys_clock.c @@ -331,12 +331,6 @@ void _init_timeout(struct _timeout *t, _timeout_func_t func) */ t->delta_ticks_from_prev = _INACTIVE; - /* - * Must be initialized here so that k_wakeup can - * verify the thread is not on a wait queue before aborting a timeout. - */ - t->wait_q = NULL; - /* * Must be initialized here, so the _handle_one_timeout() * routine can check if there is a thread waiting on this timeout @@ -366,10 +360,8 @@ void _init_thread_timeout(struct _thread_base *thread_base) static inline void _unpend_thread_timing_out(struct k_thread *thread, struct _timeout *timeout_obj) { - __ASSERT(thread->base.pended_on == (void*)timeout_obj->wait_q, ""); - if (timeout_obj->wait_q) { + if (thread->base.pended_on) { _unpend_thread_no_timeout(thread); - thread->base.timeout.wait_q = NULL; } } @@ -448,11 +440,11 @@ static inline void _dump_timeout(struct _timeout *timeout, int extra_tab) char *tab = extra_tab ? "\t" : ""; K_DEBUG("%stimeout %p, prev: %p, next: %p\n" - "%s\tthread: %p, wait_q: %p\n" + "%s\tthread: %p\n" "%s\tticks remaining: %d\n" "%s\tfunction: %p\n", tab, timeout, timeout->node.prev, timeout->node.next, - tab, timeout->thread, timeout->wait_q, + tab, timeout->thread, tab, timeout->delta_ticks_from_prev, tab, timeout->func); #endif @@ -510,7 +502,6 @@ void _add_timeout(struct k_thread *thread, struct _timeout *timeout, timeout->delta_ticks_from_prev = timeout_in_ticks; timeout->thread = thread; - timeout->wait_q = (sys_dlist_t *)wait_q; K_DEBUG("before adding timeout %p\n", timeout); _dump_timeout(timeout, 0);