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 75d29212..9c4da817 100644 --- a/include/list.h +++ b/include/list.h @@ -33,6 +33,17 @@ static inline void init_list_head(struct list_head *list) list->prev = list; } +/** + * list_is_first -- tests whether @list is the first entry in list @head + * @list: the entry to test + * @head: the head of the list + */ +static inline int list_is_first(const struct list_head *list, + const struct list_head *head) +{ + return list->prev == head; +} + /* * Insert a new entry between two known consecutive entries. * |