diff options
author | Sughosh Ganu <sughosh.ganu@linaro.org> | 2024-08-28 22:24:22 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-08-30 13:51:38 -0600 |
commit | be222ac029c31b38ffdfdc135ced8b5a40b8216b (patch) | |
tree | 3546c8860d46694952674e88766c6e0eccbe71ad /lib | |
parent | e83ced1a24095de66e526bd6c10f0f24584baaee (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 <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fwu_updates/fwu_mtd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/fwu_updates/fwu_mtd.c b/lib/fwu_updates/fwu_mtd.c index ccaba3f3115..c14203b9dd3 100644 --- a/lib/fwu_updates/fwu_mtd.c +++ b/lib/fwu_updates/fwu_mtd.c @@ -60,10 +60,7 @@ int fwu_mtd_get_alt_num(efi_guid_t *image_id, u8 *alt_num, if (ret) return -ENOENT; - nalt = 0; - list_for_each_entry(dfu, &dfu_list, list) - nalt++; - + nalt = list_count_nodes(&dfu_list); if (!nalt) { log_warning("No entities in dfu_alt_info\n"); dfu_free_entities(); |