sctp: use list_* in sctp_list_dequeue

Use list_* helpers in sctp_list_dequeue, more readable.

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Marcelo Ricardo Leitner 2016-04-01 14:30:32 -03:00 committed by David S. Miller
parent e43569e6d3
commit eb8e97715f
1 changed files with 2 additions and 4 deletions

View File

@ -386,11 +386,9 @@ static inline struct list_head *sctp_list_dequeue(struct list_head *list)
{
struct list_head *result = NULL;
if (list->next != list) {
if (!list_empty(list)) {
result = list->next;
list->next = result->next;
list->next->prev = list;
INIT_LIST_HEAD(result);
list_del_init(result);
}
return result;
}