diff options
Diffstat (limited to 'include/list.h')
| -rw-r--r-- | include/list.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/list.h b/include/list.h index 857921e3..37fbe3e2 100644 --- a/include/list.h +++ b/include/list.h @@ -349,6 +349,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_head 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_next_entry - get the next element in list * @pos: the type * to cursor * @member: the name of the list_head within the struct. |
