mirror of https://gitee.com/openkylin/linux.git
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:
parent
e43569e6d3
commit
eb8e97715f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue