diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2024-07-31 10:13:04 +0200 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2024-08-11 07:47:23 +0200 |
commit | 68bd3456689bceecba23707b9b73d63b2a501f53 (patch) | |
tree | 515148c9123f71c32dfdb6b99de783fb64a0ec50 /lib/efi_loader/efi_boottime.c | |
parent | 7bd2559cb30a4e800db519e88a22a25f13c753ec (diff) |
efi_loader: use list_count_nodes() in efi_protocols_per_handle()
Simplify the code by using the list_count_nodes() function.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index eedc5f39549..4f52284b4c6 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -2509,16 +2509,12 @@ static efi_status_t EFIAPI efi_protocols_per_handle( return EFI_EXIT(EFI_INVALID_PARAMETER); *protocol_buffer = NULL; - *protocol_buffer_count = 0; efiobj = efi_search_obj(handle); if (!efiobj) return EFI_EXIT(EFI_INVALID_PARAMETER); - /* Count protocols */ - list_for_each(protocol_handle, &efiobj->protocols) { - ++*protocol_buffer_count; - } + *protocol_buffer_count = list_count_nodes(&efiobj->protocols); /* Copy GUIDs */ if (*protocol_buffer_count) { |