diff options
| author | Ada Christine <adachristine18@gmail.com> | 2024-04-04 19:03:35 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2024-04-04 19:03:35 +0000 |
| commit | 7fd8c908b9dafa85957bb6e6ce3f51d4dfa7c4dc (patch) | |
| tree | 0583c11bfcce1c1e14617f6ab5ecf74901848eb6 | |
| parent | faccd51b0c8558d42b42e54321aa50087897198d (diff) | |
smaller construct
| -rw-r--r-- | boot/efi/protocol.c | 7 |
1 files changed, 1 insertions, 6 deletions
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) |
