From 7fd8c908b9dafa85957bb6e6ce3f51d4dfa7c4dc Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Thu, 4 Apr 2024 19:03:35 +0000 Subject: smaller construct --- boot/efi/protocol.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'boot/efi/protocol.c') diff --git a/boot/efi/protocol.c b/boot/efi/protocol.c index 6bf8123..b033022 100644 --- a/boot/efi/protocol.c +++ b/boot/efi/protocol.c @@ -14,12 +14,7 @@ void *efi_get_protocol(EFI_HANDLE handle, EFI_GUID *guid) nullptr, EFI_OPEN_PROTOCOL_GET_PROTOCOL); - if (EFI_ERROR(efi_errno)) - { - return nullptr; - } - - return protocol; + return !EFI_ERROR(efi_errno) ? protocol : nullptr; } void efi_close_protocol(EFI_HANDLE handle, EFI_GUID *guid) -- cgit v1.3.1-1-g115d