Skip to content
Snippets Groups Projects
Commit 42cf1242 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alexander Graf
Browse files

efi_loader: simplify efi_search


Use helper function efi_search_protocol in efi_search.
Add missing comments.
Put default handling into default branch of switch statement.

Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 1202530d
Branches
Tags
No related merge requests found
...@@ -983,24 +983,21 @@ static int efi_search(enum efi_locate_search_type search_type, ...@@ -983,24 +983,21 @@ static int efi_search(enum efi_locate_search_type search_type,
const efi_guid_t *protocol, void *search_key, const efi_guid_t *protocol, void *search_key,
struct efi_object *efiobj) struct efi_object *efiobj)
{ {
int i; efi_status_t ret;
switch (search_type) { switch (search_type) {
case ALL_HANDLES: case ALL_HANDLES:
return 0; return 0;
case BY_REGISTER_NOTIFY: case BY_REGISTER_NOTIFY:
/* RegisterProtocolNotify is not implemented yet */ /* TODO: RegisterProtocolNotify is not implemented yet */
return -1; return -1;
case BY_PROTOCOL: case BY_PROTOCOL:
for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { ret = efi_search_protocol(efiobj->handle, protocol, NULL);
const efi_guid_t *guid = efiobj->protocols[i].guid; return (ret != EFI_SUCCESS);
if (guid && !guidcmp(guid, protocol)) default:
return 0; /* Invalid search type */
}
return -1; return -1;
} }
return -1;
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment