Skip to content

Commit

Permalink
kernel: Explicitly ignoring results of queue_insert
Browse files Browse the repository at this point in the history
queue_insert will always return 0 when no memory is allocated, just
explicitly marking that we are ignoring return value in these cases.

Signed-off-by: Flavio Ceolin <[email protected]>
  • Loading branch information
Flavio Ceolin authored and nashif committed Aug 17, 2018
1 parent 8aec087 commit cc74ad0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,17 +184,18 @@ static int queue_insert(struct k_queue *queue, void *prev, void *data,

void k_queue_insert(struct k_queue *queue, void *prev, void *data)
{
queue_insert(queue, prev, data, false);
(void)queue_insert(queue, prev, data, false);
}

void k_queue_append(struct k_queue *queue, void *data)
{
queue_insert(queue, sys_sflist_peek_tail(&queue->data_q), data, false);
(void)queue_insert(queue, sys_sflist_peek_tail(&queue->data_q),
data, false);
}

void k_queue_prepend(struct k_queue *queue, void *data)
{
queue_insert(queue, NULL, data, false);
(void)queue_insert(queue, NULL, data, false);
}

int _impl_k_queue_alloc_append(struct k_queue *queue, void *data)
Expand Down

0 comments on commit cc74ad0

Please sign in to comment.