1
0
Fork 0
forked from len0rd/rockbox

linked list: inline list init functions

These functions are so trivial it's always cheaper to inline them.

Change-Id: Ie0c77c8b6e7a716312105445a22e62ff57a76d90
This commit is contained in:
Aidan MacDonald 2022-09-24 14:38:04 +01:00
parent 8bf8036021
commit ee9679993b
2 changed files with 31 additions and 32 deletions

View file

@ -45,15 +45,6 @@ static struct ll_node * ll_search_prev(struct ll_head *list,
return prev;
}
/**
* Initializes the singly-linked list
*/
void ll_init(struct ll_head *list)
{
list->head = NULL;
list->tail = NULL;
}
/**
* Adds a node to s singly-linked list using "insert next"
*/
@ -142,18 +133,6 @@ void ll_remove(struct ll_head *list, struct ll_node *node)
/** (L)inked (L)ist (D)ouble **/
/**
* Initializes the doubly-linked list
*/
void lld_init(struct lld_head *list)
{
list->head = NULL;
list->tail = NULL;
/* tail could be stored in first item's prev pointer but this simplifies
the routines and maintains the non-circularity */
}
/**
* Adds a node to a doubly-linked list using "insert first"
*/
@ -237,14 +216,6 @@ static inline struct lldc_node * lldc_insert(struct lldc_head *list,
return head;
}
/**
* Initializes the doubly-linked circular list
*/
void lldc_init(struct lldc_head *list)
{
list->head = NULL;
}
/**
* Adds a node to a doubly-linked circular list using "insert first"
*/