From: Hauke Mehrtens Date: Sat, 9 Aug 2014 12:00:51 +0000 (+0200) Subject: backports: add list_next_entry() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=966bc8a51503d4ac3e51f767d7dcabdb013160b3;p=openwrt%2Fstaging%2Fblogic.git backports: add list_next_entry() Signed-off-by: Hauke Mehrtens --- diff --git a/backport/backport-include/linux/list.h b/backport/backport-include/linux/list.h index 4e1b3ca44e77..90428307a289 100644 --- a/backport/backport-include/linux/list.h +++ b/backport/backport-include/linux/list.h @@ -63,4 +63,14 @@ (!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL) #endif /* list_first_entry_or_null */ +#ifndef list_next_entry +/** + * list_next_entry - get the next element in list + * @pos: the type * to cursor + * @member: the name of the list_struct within the struct. + */ +#define list_next_entry(pos, member) \ + list_entry((pos)->member.next, typeof(*(pos)), member) +#endif /* list_next_entry */ + #endif /* __BACKPORT_LIST_H */