diff options
| author | Peter Jones <pjones@redhat.com> | 2013-05-15 13:38:00 -0400 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-05-15 13:38:00 -0400 |
| commit | df87084fca75948b72fc49868a92493a77a1999d (patch) | |
| tree | 7ca55b8214cbfa385eecc8ae7b6699fbb237ae0e /shim.c | |
| parent | 073f3b3cafc4ee4bf86cbefafcfa5b0ac3317cfd (diff) | |
| download | efi-boot-shim-df87084fca75948b72fc49868a92493a77a1999d.tar.gz efi-boot-shim-df87084fca75948b72fc49868a92493a77a1999d.zip | |
Remove some unnecessary code.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'shim.c')
| -rw-r--r-- | shim.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -905,8 +905,6 @@ should_use_fallback(EFI_HANDLE image_handle) { EFI_GUID loaded_image_protocol = LOADED_IMAGE_PROTOCOL; EFI_LOADED_IMAGE *li; - EFI_DEVICE_PATH *devpath; - int i; unsigned int pathlen = 0; CHAR16 *bootpath; EFI_FILE_IO_INTERFACE *fio = NULL; @@ -919,9 +917,7 @@ should_use_fallback(EFI_HANDLE image_handle) if (EFI_ERROR(rc)) return 0; - devpath = li->FilePath; - - bootpath = DevicePathToStr(devpath); + bootpath = DevicePathToStr(li->FilePath); /* Check the beginning of the string and the end, to avoid * caring about which arch this is. */ @@ -931,17 +927,11 @@ should_use_fallback(EFI_HANDLE image_handle) if (StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\BOOT", 14) && StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\/BOOT", 15)) return 0; + pathlen = StrLen(bootpath); if (pathlen < 5 || StrCaseCmp(bootpath + pathlen - 4, L".EFI")) return 0; - for (i=pathlen; i>0; i--) { - if (bootpath[i] == '\\') - break; - } - - bootpath[i+1] = '\0'; - rc = uefi_call_wrapper(BS->HandleProtocol, 3, li->DeviceHandle, &FileSystemProtocol, (void **)&fio); if (EFI_ERROR(rc)) |
