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:
Raul E Rangel
2021-11-01 13:40:14 -06:00
committed by Patrick Georgi
parent 74a0629660
commit 4c8c8442ab
3 changed files with 30 additions and 0 deletions

View File

@ -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);
}