summaryrefslogtreecommitdiff
path: root/lib/execute.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2017-10-19 15:02:41 -0400
committerPeter Jones <pmjones@gmail.com>2018-03-12 16:21:43 -0400
commita55b4d6688879b7dae213bc2b56ce95d4c70d6c4 (patch)
tree350b8bf50079f2adf1b09cfdc8a405cd8d70d12a /lib/execute.c
parent4816cd7533f7a9921bd945c12a1fcec48d95c2ed (diff)
downloadefi-boot-shim-a55b4d6688879b7dae213bc2b56ce95d4c70d6c4.tar.gz
efi-boot-shim-a55b4d6688879b7dae213bc2b56ce95d4c70d6c4.zip
lib: Use EFI_ERROR() instead of comparing to EFI_SUCCESS everywhere.
Also consistently name our status variable "efi_status" unless there's a good reason not to, such as already having another one of those. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'lib/execute.c')
-rw-r--r--lib/execute.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/execute.c b/lib/execute.c
index 4abccc73..7bd775fa 100644
--- a/lib/execute.c
+++ b/lib/execute.c
@@ -95,32 +95,32 @@ error:
EFI_STATUS
execute(EFI_HANDLE image, CHAR16 *name)
{
- EFI_STATUS status;
+ EFI_STATUS efi_status;
EFI_HANDLE h;
EFI_LOADED_IMAGE *li;
EFI_DEVICE_PATH *devpath;
CHAR16 *PathName;
- status = uefi_call_wrapper(BS->HandleProtocol, 3, image,
- &IMAGE_PROTOCOL, (void **)&li);
- if (status != EFI_SUCCESS)
- return status;
+ efi_status = uefi_call_wrapper(BS->HandleProtocol, 3, image,
+ &IMAGE_PROTOCOL, (void **)&li);
+ if (EFI_ERROR(efi_status))
+ return efi_status;
-
- status = generate_path(name, li, &devpath, &PathName);
- if (status != EFI_SUCCESS)
- return status;
- status = uefi_call_wrapper(BS->LoadImage, 6, FALSE, image,
- devpath, NULL, 0, &h);
- if (status != EFI_SUCCESS)
+ efi_status = generate_path(name, li, &devpath, &PathName);
+ if (EFI_ERROR(efi_status))
+ return efi_status;
+
+ efi_status = uefi_call_wrapper(BS->LoadImage, 6, FALSE, image,
+ devpath, NULL, 0, &h);
+ if (EFI_ERROR(efi_status))
goto out;
-
- status = uefi_call_wrapper(BS->StartImage, 3, h, NULL, NULL);
+
+ efi_status = uefi_call_wrapper(BS->StartImage, 3, h, NULL, NULL);
uefi_call_wrapper(BS->UnloadImage, 1, h);
out:
FreePool(PathName);
FreePool(devpath);
- return status;
+ return efi_status;
}