acassis commented on code in PR #17077:
URL: https://github.com/apache/nuttx/pull/17077#discussion_r2382212516


##########
include/nuttx/list.h:
##########
@@ -281,10 +281,17 @@
        &(cur)->member != (list); \
        (cur) = (temp), (temp) = list_next_entry(temp, type, member))
 
-#define list_for_every_entry_continue(list, head, type, member)    \
-  for ((list) = list_next_entry(list, type, member); \
-       &(list)->member != (head); \
-       (list) = list_next_entry(list, type, member))
+/* Prepare entry for use in list_for_every_entry_continue() */
+
+#define list_prepare_entry(entry, list, type, member) \
+  ((entry) ? : list_entry(list, type, member))

Review Comment:
   It is better to avoid the "omitted middle operand conditional" because it is 
a GCC extension and it is not supposed to work for old compilers (remember: you 
are modifying common code that should work with old C89 compilers).
   
   Please use:
   
   ```
   ((entry) ? (NULL) : list_entry(list, type, 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]

Reply via email to