summaryrefslogtreecommitdiff
path: root/include/linux/list.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-10-12 08:32:09 -0400
committerTom Rini <trini@konsulko.com>2016-10-12 13:59:26 -0400
commit5ebd27d860ec0c6e36f1b0f973653fe66a7360be (patch)
tree71ba0f39cc03c131889ce51803d85cf4c49b2941 /include/linux/list.h
parentf812574e61e9bfe37e76e620606fd1a65cc9cdc2 (diff)
parent00bcaedd5c4063c677d16af264bbcb991fb9675c (diff)
Merge branch 'master' of git://git.denx.de/u-boot-x86
Diffstat (limited to 'include/linux/list.h')
-rw-r--r--include/linux/list.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index b78851c3d71..5b8d1df5dfe 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -338,6 +338,17 @@ static inline void list_splice_tail_init(struct list_head *list,
list_entry((ptr)->next, type, member)
/**
+ * list_last_entry - get the last element from a list
+ * @ptr: the list head to take the element from.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_last_entry(ptr, type, member) \
+ list_entry((ptr)->prev, type, member)
+
+/**
* list_for_each - iterate over a list
* @pos: the &struct list_head to use as a loop cursor.
* @head: the head for your list.