mirror of https://gerrit.osmocom.org/libosmocore
linuxlist: add llist_entry_empty()
Return true if an entry is not included in a llist or NULL. Change-Id: Ia4afe3e77f53728db1d139bded5925183dca011f
This commit is contained in:
parent
61359a2cdd
commit
8f23dfa914
|
@ -171,6 +171,17 @@ static inline int llist_empty(const struct llist_head *head)
|
|||
return head->next == head;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Test whether a linked list entry is empty or not included by any list.
|
||||
* \param[in] entry the llist to test
|
||||
* \return 1 if the entry is NULL or not included by any llist.
|
||||
*/
|
||||
static inline int llist_entry_empty(const struct llist_head *entry)
|
||||
{
|
||||
return entry == NULL || (!entry->next && !entry->prev)
|
||||
|| (entry->next == LLIST_POISON1 && entry->prev == LLIST_POISON2);
|
||||
}
|
||||
|
||||
static inline void __llist_splice(struct llist_head *llist,
|
||||
struct llist_head *head)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue