Commit b65db76e authored by Alejandro Mery's avatar Alejandro Mery
Browse files

sunxi-tools.h: add list_last() helper

parent 065e3acd
......@@ -48,6 +48,12 @@ static inline void list_append(struct list_entry *l0, struct list_entry *l1)
l0->prev = l1;
}
/** returns list element of a list */
static inline struct list_entry *list_last(struct list_entry *l)
{
return (l->prev == l) ? (void*)0 : l->prev;
}
/** is list empty? */
static inline int list_empty(struct list_entry *l)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment