|
@@ -372,6 +372,22 @@ static inline void list_splice_tail_init(struct list_head *list,
|
|
|
#define list_first_entry_or_null(ptr, type, member) \
|
|
|
(!list_empty(ptr) ? list_first_entry(ptr, type, member) : NULL)
|
|
|
|
|
|
+/**
|
|
|
+ * 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)
|
|
|
+
|
|
|
+/**
|
|
|
+ * list_prev_entry - get the prev element in list
|
|
|
+ * @pos: the type * to cursor
|
|
|
+ * @member: the name of the list_struct within the struct.
|
|
|
+ */
|
|
|
+#define list_prev_entry(pos, member) \
|
|
|
+ list_entry((pos)->member.prev, typeof(*(pos)), member)
|
|
|
+
|
|
|
/**
|
|
|
* list_for_each - iterate over a list
|
|
|
* @pos: the &struct list_head to use as a loop cursor.
|