diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-03-05 00:36:50 +0100 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-03-20 11:03:06 +0100 |
commit | b78631d54f72f063e1f2a5d14a349b1b0d8fbce7 (patch) | |
tree | 40d7f34d85102231badd080d696b8557af8ba4bd /lib/efi_loader/efi_disk.c | |
parent | 90dcd9b2d3a318391453d9d623d931a568906cb5 (diff) | |
download | u-boot-b78631d54f72f063e1f2a5d14a349b1b0d8fbce7.zip u-boot-b78631d54f72f063e1f2a5d14a349b1b0d8fbce7.tar.gz u-boot-b78631d54f72f063e1f2a5d14a349b1b0d8fbce7.tar.bz2 |
efi_loader: remove efi_disk_is_system_part()
The block IO protocol may be installed on any handle. We should make
no assumption about the structure the handle points to.
efi_disk_is_system_part() makes an illegal widening cast from a handle
to a struct efi_disk_obj. Remove the function.
Fixes: Fixes: 41fd506842c2 ("efi_loader: disk: add efi_disk_is_system_part()")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_disk.c')
-rw-r--r-- | lib/efi_loader/efi_disk.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index d36a35d..c905c12 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -587,32 +587,3 @@ efi_status_t efi_disk_register(void) return EFI_SUCCESS; } - -/** - * efi_disk_is_system_part() - check if handle refers to an EFI system partition - * - * @handle: handle of partition - * - * Return: true if handle refers to an EFI system partition - */ -bool efi_disk_is_system_part(efi_handle_t handle) -{ - struct efi_handler *handler; - struct efi_disk_obj *diskobj; - struct disk_partition info; - efi_status_t ret; - int r; - - /* check if this is a block device */ - ret = efi_search_protocol(handle, &efi_block_io_guid, &handler); - if (ret != EFI_SUCCESS) - return false; - - diskobj = container_of(handle, struct efi_disk_obj, header); - - r = part_get_info(diskobj->desc, diskobj->part, &info); - if (r) - return false; - - return !!(info.bootable & PART_EFI_SYSTEM_PARTITION); -} |