mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-04 20:26:13 +02:00
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>
This commit is contained in:
parent
7bd2559cb3
commit
68bd345668
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user