kernel/timeout: Remove timeout wait_q field

Per previous patch, this is known to be identical with
thread->pended_on.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-09-26 13:36:02 -07:00 committed by Anas Nashif
commit d61b1f8ef8
3 changed files with 3 additions and 14 deletions

View file

@ -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), \

View file

@ -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;
};

View file

@ -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);