JianyuWang0623 opened a new pull request, #17077:
URL: https://github.com/apache/nuttx/pull/17077
## Summary
1. Add `list_prepare_entry()` to prepare entry for use in
`list_for_every_entry_continue()`.
2. Update the parameter names of the macro `list_for_every_entry_continue()`
to maintain consistent naming. Most take the head node (list) as the first
parameter, but considering that there is already code using this macro, the
parameter order will not be adjusted here.
The parameter order remains unchanged, so it will _**NOT affect the
usage**_.
1. list => entry
2. head => list
> The `list_prepare_entry()` references the implementation of Linux. See
https://github.com/torvalds/linux/blob/v6.12/include/linux/list.h#L793-L802
## Impact
- include/nuttx/list
## Testing
- Selftest
```C
struct xxxx_s
{
/* ... */
struct list_node node;
} *current;
struct list_node head;
/* ... */
current = list_prepare_entry(current, &head, struct xxxx_s, node);
list_for_every_entry_continue(current, &head, struct xxxx_s, node)
{
/* ... */
}
```
- CI
--
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]