kernel: work: remove unused if statement

Condition of work == NULL is checked before, so there is no need to
check it again.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
This commit is contained in:
Lixin Guo 2021-12-07 16:05:43 +08:00 committed by Anas Nashif
commit d4826d874e

View file

@ -586,6 +586,7 @@ static void work_queue_main(void *workq_ptr, void *p2, void *p3)
struct k_work *work = NULL;
k_work_handler_t handler = NULL;
k_spinlock_key_t key = k_spin_lock(&lock);
bool yield;
/* Check for and prepare any new work. */
node = sys_slist_get(&queue->pending);
@ -644,9 +645,6 @@ static void work_queue_main(void *workq_ptr, void *p2, void *p3)
k_spin_unlock(&lock, key);
if (work != NULL) {
bool yield;
__ASSERT_NO_MSG(handler != NULL);
handler(work);
@ -674,7 +672,6 @@ static void work_queue_main(void *workq_ptr, void *p2, void *p3)
}
}
}
}
void k_work_queue_init(struct k_work_q *queue)
{