lib/list: Add list_append
This method will add a node to the end of the list. BUG=b:179699789 TEST=Boot guybrush to the OS Signed-off-by: Raul E Rangel <rrangel@chromium.org> Change-Id: I1792e40f789e3ef16ceca65ce4cae946e08583d1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58805 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
committed by
Patrick Georgi
parent
74a0629660
commit
4c8c8442ab
@ -28,3 +28,11 @@ void list_insert_before(struct list_node *node, struct list_node *before)
|
||||
if (node->prev)
|
||||
node->prev->next = node;
|
||||
}
|
||||
|
||||
void list_append(struct list_node *node, struct list_node *head)
|
||||
{
|
||||
while (head->next)
|
||||
head = head->next;
|
||||
|
||||
list_insert_after(node, head);
|
||||
}
|
||||
|
Reference in New Issue
Block a user