MCPcopy Create free account
hub / github.com/coreboot/coreboot / list_move

Function list_move

src/commonlib/list.c:65–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65void list_move(struct list_node *dst_head, struct list_node *src_head)
66{
67 assert(list_is_empty(dst_head));
68
69 if (list_is_empty(src_head))
70 return;
71
72 NEXT(dst_head) = NEXT(src_head);
73 PREV(dst_head) = PREV(src_head);
74
75 /* The elements formerly in src_head's list must now point back to dst_head. */
76 NEXT(PREV(dst_head)) = dst_head;
77 PREV(NEXT(dst_head)) = dst_head;
78
79 /* Clear src_head to be empty. */
80 list_clear(src_head);
81}
82
83#undef NEXT
84#undef PREV

Callers 4

dt_copy_subtreeFunction · 0.85
test_list_moveFunction · 0.85
test_list_move_emptyFunction · 0.85
test_list_move_invalidFunction · 0.85

Calls 2

list_is_emptyFunction · 0.85
list_clearFunction · 0.85

Tested by 3

test_list_moveFunction · 0.68
test_list_move_emptyFunction · 0.68
test_list_move_invalidFunction · 0.68