kernel: queue: Fix MISRA-C violation

MISRA-C requires the right-hand operand of && or || operator does not
contain persistent effect.

MISRA-C rule 13.5

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2018-11-13 16:26:56 -08:00 committed by Anas Nashif
commit a42de6466a

View file

@ -235,12 +235,16 @@ void k_queue_append_list(struct k_queue *queue, void *head, void *tail)
unsigned int key = irq_lock();
#if !defined(CONFIG_POLL)
struct k_thread *thread;
struct k_thread *thread = NULL;
while ((head != NULL) &&
(thread = _unpend_first_thread(&queue->wait_q))) {
if (head) {
thread = _unpend_first_thread(&queue->wait_q);
}
while ((head != NULL) && (thread != NULL)) {
prepare_thread_to_run(thread, head);
head = *(void **)head;
thread = _unpend_first_thread(&queue->wait_q);
}
if (head != NULL) {