summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSughosh Ganu <[email protected]>2024-08-28 22:24:22 +0530
committerTom Rini <[email protected]>2024-08-30 13:51:38 -0600
commitbe222ac029c31b38ffdfdc135ced8b5a40b8216b (patch)
tree3546c8860d46694952674e88766c6e0eccbe71ad /boot
parente83ced1a24095de66e526bd6c10f0f24584baaee (diff)
list: use list_count_nodes() to count list entries
Use the API function list_count_nodes() to count the number of list entries. Signed-off-by: Sughosh Ganu <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'boot')
-rw-r--r--boot/scene.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/boot/scene.c b/boot/scene.c
index ac976aa26bb..270c9c67233 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -79,13 +79,7 @@ int scene_title_set(struct scene *scn, uint id)
int scene_obj_count(struct scene *scn)
{
- struct scene_obj *obj;
- int count = 0;
-
- list_for_each_entry(obj, &scn->obj_head, sibling)
- count++;
-
- return count;
+ return list_count_nodes(&scn->obj_head);
}
void *scene_obj_find(const struct scene *scn, uint id, enum scene_obj_t type)