Lines Matching refs:head
55 static inline void mpp_list_add(MppListNode *_new, MppListNode *head) in mpp_list_add() argument
57 _mpp_list_add(_new, head, head->next); in mpp_list_add()
60 static inline void mpp_list_add_tail(MppListNode *_new, MppListNode *head) in mpp_list_add_tail() argument
62 _mpp_list_add(_new, head->prev, head); in mpp_list_add_tail()
69 if (list->head) { in mpp_list_add_at_head()
72 mpp_list_add(node, list->head); in mpp_list_add_at_head()
86 if (list->head) { in mpp_list_add_at_tail()
90 mpp_list_add_tail(node, list->head); in mpp_list_add_at_tail()
138 if (list->head && list->count) { in mpp_list_del_at_head()
139 _list_del_node_no_lock(list->head->next, data, size); in mpp_list_del_at_head()
150 if (list->head && list->count) { in mpp_list_del_at_tail()
151 _list_del_node_no_lock(list->head->prev, data, size); in mpp_list_del_at_tail()
176 if (list && list->head) { in mpp_list_fifo_wr()
180 mpp_list_add_tail(node, list->head); in mpp_list_fifo_wr()
207 if (list && list->head && list->count) { in mpp_list_fifo_rd()
208 MppListNode *node = list->head->next; in mpp_list_fifo_rd()
232 if (list->head) { in mpp_list_add_by_key()
239 mpp_list_add_tail(node, list->head); in mpp_list_add_by_key()
253 if (list && list->head && list->count) { in mpp_list_del_by_key()
254 MppListNode *tmp = list->head->next; in mpp_list_del_by_key()
257 while (tmp->next != list->head) { in mpp_list_del_by_key()
282 if (list->head) { in mpp_list_flush()
284 MppListNode* node = list->head->next; in mpp_list_flush()
400 list->head = mpp_malloc(MppListNode, 1); in mpp_list_create()
401 if (list->head == NULL) { in mpp_list_create()
407 list_node_init_with_key_and_size(list->head, 0, 0); in mpp_list_create()
423 node = list->head->next; in mpp_list_destroy()
424 while (node != list->head) { in mpp_list_destroy()
433 mpp_free(list->head); in mpp_list_destroy()
434 list->head = NULL; in mpp_list_destroy()
450 struct list_head *head, **tail = &head; in merge() local
472 return head; in merge()
482 static void merge_final(void *priv, ListCmpFunc cmp, struct list_head *head, in merge_final() argument
485 struct list_head *tail = head; in merge_final()
527 tail->next = head; in merge_final()
528 head->prev = tail; in merge_final()
531 void list_sort(void *priv, struct list_head *head, ListCmpFunc cmp) in list_sort() argument
533 struct list_head *list = head->next, *pending = NULL; in list_sort()
536 if (list == head->prev) /* Zero or one elements */ in list_sort()
540 head->prev->next = NULL; in list_sort()
597 merge_final(priv, cmp, head, pending, list); in list_sort()