From: Arnaldo Carvalho de Melo Date: Tue, 21 Mar 2006 01:19:17 +0000 (-0800) Subject: [LIST]: Introduce list_for_each_entry_from X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e229c2fb3370a0c4ebac06cad67ce1cb35abcfe6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [LIST]: Introduce list_for_each_entry_from For iterating over list of given type continuing from existing point. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: David S. Miller --- diff --git a/include/linux/list.h b/include/linux/list.h index beb6e48e116f..67258b47e9ca 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -410,6 +410,17 @@ static inline void list_splice_init(struct list_head *list, prefetch(pos->member.next), &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member)) +/** + * list_for_each_entry_from - iterate over list of given type + * continuing from existing point + * @pos: the type * to use as a loop counter. + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_from(pos, head, member) \ + for (; prefetch(pos->member.next), &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) + /** * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry * @pos: the type * to use as a loop counter.