Browse Source

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>
Marcelo Ricardo Leitner 9 years ago
parent
commit
eb8e97715f
1 changed files with 2 additions and 4 deletions
  1. 2 4
      include/net/sctp/sctp.h

+ 2 - 4
include/net/sctp/sctp.h

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