Skip to content

Commit

Permalink
misc: slist: Rework sys_slist_get_not_empty
Browse files Browse the repository at this point in the history
Magic spell to address zephyrproject-rtos#4022.

Signed-off-by: Paul Sokolovsky <[email protected]>
  • Loading branch information
pfalcon committed Oct 16, 2017
1 parent de6fafb commit 5fa972d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/misc/slist.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ static inline sys_snode_t *sys_slist_get_not_empty(sys_slist_t *list)
{
sys_snode_t *node = list->head;

list->head = node->next;
if (list->tail == node) {
list->tail = list->head;
list->tail = NULL;
}
list->head = node->next;

return node;
}
Expand Down

0 comments on commit 5fa972d

Please sign in to comment.