Skip to content

Commit

Permalink
sctp: use list_* in sctp_list_dequeue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
marceloleitner authored and davem330 committed Apr 5, 2016
1 parent e43569e commit eb8e977
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/net/sctp/sctp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit eb8e977

Please sign in to comment.