aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-11-06 21:17:50 +0100
committerAlexander Graf <agraf@suse.de>2017-12-01 13:22:56 +0100
commit1b68153af1ff0af3828ad7de0d0319a456ff19f7 (patch)
tree39885ac8416bcfd12d98114ae125b0033e6be991 /lib
parentcaf864e434b3f12bae0c7e5932045ff8c9383180 (diff)
downloadu-boot-1b68153af1ff0af3828ad7de0d0319a456ff19f7.zip
u-boot-1b68153af1ff0af3828ad7de0d0319a456ff19f7.tar.gz
u-boot-1b68153af1ff0af3828ad7de0d0319a456ff19f7.tar.bz2
efi_loader: rework efi_search_obj
EFI_HANDLEs are used both in boottime and in runtime services. efi_search_obj is a function that can be used to validate handles. So let's make it accessible via efi_loader.h. We can simplify the coding using list_for_each_entry. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_boottime.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index fdbdfc4..2cc6d89 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -684,14 +684,11 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event)
* @handle handle to find
* @return EFI object
*/
-static struct efi_object *efi_search_obj(void *handle)
+struct efi_object *efi_search_obj(void *handle)
{
- struct list_head *lhandle;
-
- list_for_each(lhandle, &efi_obj_list) {
- struct efi_object *efiobj;
+ struct efi_object *efiobj;
- efiobj = list_entry(lhandle, struct efi_object, link);
+ list_for_each_entry(efiobj, &efi_obj_list, link) {
if (efiobj->handle == handle)
return efiobj;
}