Skip to content

Commit

Permalink
libmetal: add metal_list_for_each_safe() support
Browse files Browse the repository at this point in the history
Signed-off-by: liguiding <[email protected]>
  • Loading branch information
GUIDINGLI authored and yintao committed Sep 12, 2023
1 parent 0ad1183 commit 68bfbb8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ static inline struct metal_list *metal_list_first(struct metal_list *list)
(node) != (list); \
(node) = (node)->next)

#define metal_list_for_each_safe(list, node, temp) \
for (node = (list)->next, temp = node->next; \
node != (list); node = temp, temp = node->next)

static inline bool metal_list_find_node(struct metal_list *list,
struct metal_list *node)
{
Expand Down

0 comments on commit 68bfbb8

Please sign in to comment.