diff options
| author | Patrick Mochel <mochel@osdl.org> | 2003-06-10 01:25:48 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-06-10 01:25:48 -0700 |
| commit | be9e929da5c6deff7004e455010965ef71998324 (patch) | |
| tree | fffaa7c1ddab0af300d720828e3b4eab5c53f4b2 /include/linux/list.h | |
| parent | ae6a0c465d560a2c5e1fa16dd3d2ed769119cf2c (diff) | |
| parent | 3d983e57eeb0d84ffafe1bb5b78688646ebd1d17 (diff) | |
Hand merge
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 abf35a4e5b37..be4be88015d7 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -297,6 +297,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 |
