From 68bd3456689bceecba23707b9b73d63b2a501f53 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 31 Jul 2024 10:13:04 +0200 Subject: 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 --- lib/efi_loader/efi_boottime.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') 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) { -- cgit v1.3.1 From 751e5bfdb531aa3093e02d616a4f0bce701e8b50 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 7 Aug 2024 00:11:38 +0200 Subject: efi_loader: correct description of efi_get_distro_fdt_name Use the correct function name. Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass Reviewed-by: Ilias Apalodimas --- lib/efi_loader/efi_fdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/efi_loader/efi_fdt.c b/lib/efi_loader/efi_fdt.c index c5ecade3aeb..f882622fdad 100644 --- a/lib/efi_loader/efi_fdt.c +++ b/lib/efi_loader/efi_fdt.c @@ -14,7 +14,7 @@ #include /** - * distro_efi_get_fdt_name() - get the filename for reading the .dtb file + * efi_get_distro_fdt_name() - get the filename for reading the .dtb file * * @fname: buffer for filename * @size: buffer size -- cgit v1.3.1