diff options
| author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-10 01:46:36 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-10 01:46:36 -0700 |
| commit | b7f523b5dfd0cc3ca3209e8f6d0519ee63bd8bf6 (patch) | |
| tree | 8bf659f35245772aa42c797443947652fe6e2afc /include/linux/list.h | |
| parent | 201be7ab47dce6e31d8b8599abf24a72cb7a37ce (diff) | |
| parent | 6508e77cc78d7abb04617bec00de21218e7d6df8 (diff) | |
Merge bk://ldm.bkbits.net/linux-2.5-core
into home.transmeta.com:/home/torvalds/v2.5/linux
Diffstat (limited to 'include/linux/list.h')
| -rw-r--r-- | include/linux/list.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index d6305f84bfe6..eed55ea5860a 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -310,6 +310,20 @@ static inline void list_splice_init(struct list_head *list, prefetch(pos->member.next)) /** + * list_for_each_entry_reverse - iterate backwards over list of given type. + * @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_reverse(pos, head, member) \ + for (pos = list_entry((head)->prev, typeof(*pos), member), \ + prefetch(pos->member.prev); \ + &pos->member != (head); \ + pos = list_entry(pos->member.prev, typeof(*pos), member), \ + prefetch(pos->member.prev)) + + +/** * 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. * @n: another type * to use as temporary storage |
