pkarashchenko commented on code in PR #10338:
URL: https://github.com/apache/nuttx/pull/10338#discussion_r1300189693
##########
include/nuttx/list.h:
##########
@@ -101,6 +110,39 @@
#define list_last_entry(list, type, member) \
list_entry((list)->prev, type, member)
+/**
+ * list_next_entry - get the next element in list
+ * @pos: the type * to cursor
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_head within the struct.
+ */
+#define list_next_entry(pos, type, member) \
+ list_entry((pos)->member.next, type, member)
+
+/**
+ * list_prev_entry - get the prev element in list
+ * @pos: the type * to cursor
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the list_head within the struct.
+ */
+#define list_prev_entry(pos, type, member) \
+ list_entry((pos)->member.prev, type, member)
+
+/**
+ * list_for_each_entry_continue - continue iteration over list of given type
+ * @pos: the type * to use as a loop cursor.
+ * @head: the head for your list.
+ * @member: the name of the list_head within the struct.
+ *
+ * Continue to iterate over list of given type, continuing after
+ * the current position.
+ */
+
+#define list_for_each_entry_continue(pos, head, member) \
+ for (pos = list_next_entry(pos, typeof(*(pos)), member); \
+ !list_entry_is_head(pos, head, member); \
+ pos = list_next_entry(pos, typeof(*(pos)), member))
Review Comment:
```suggestion
(pos) = list_next_entry(pos, typeof(*(pos)), member))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]