aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/linuxlist.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h
index f28f88b9..725c60ca 100644
--- a/include/osmocom/core/linuxlist.h
+++ b/include/osmocom/core/linuxlist.h
@@ -238,6 +238,12 @@ static inline void llist_splice_init(struct llist_head *llist,
#define llist_last_entry(ptr, type, member) \
llist_entry((ptr)->prev, type, member)
+/*! Return the last element of the list.
+ * \param head the llist head of the list.
+ * \returns last element of the list, head if the list is empty.
+ */
+#define llist_last(head) (head)->prev
+
/*! Get the first element from a list, or NULL.
* \param ptr the list head to take the element from.
* \param type the type of the struct this is embedded in.