efi_loader: reformat efi_disk_add_dev()
Make it clearer why InstallMultipleProtocolInterfaces is invoked with two NULLs: * rename guid to esp_guid * put protocol GUIDs and the related interfaces on same lines * add comment Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
parent
731ab362d5
commit
21c4d7c5dd
@ -395,7 +395,7 @@ static efi_status_t efi_disk_add_dev(
|
|||||||
{
|
{
|
||||||
struct efi_disk_obj *diskobj;
|
struct efi_disk_obj *diskobj;
|
||||||
struct efi_object *handle;
|
struct efi_object *handle;
|
||||||
const efi_guid_t *guid = NULL;
|
const efi_guid_t *esp_guid = NULL;
|
||||||
efi_status_t ret;
|
efi_status_t ret;
|
||||||
|
|
||||||
/* Don't add empty devices */
|
/* Don't add empty devices */
|
||||||
@ -439,7 +439,7 @@ static efi_status_t efi_disk_add_dev(
|
|||||||
efi_free_pool(node);
|
efi_free_pool(node);
|
||||||
diskobj->media.last_block = part_info->size - 1;
|
diskobj->media.last_block = part_info->size - 1;
|
||||||
if (part_info->bootable & PART_EFI_SYSTEM_PARTITION)
|
if (part_info->bootable & PART_EFI_SYSTEM_PARTITION)
|
||||||
guid = &efi_system_partition_guid;
|
esp_guid = &efi_system_partition_guid;
|
||||||
} else {
|
} else {
|
||||||
diskobj->dp = efi_dp_from_part(desc, part);
|
diskobj->dp = efi_dp_from_part(desc, part);
|
||||||
diskobj->media.last_block = desc->lba - 1;
|
diskobj->media.last_block = desc->lba - 1;
|
||||||
@ -454,12 +454,16 @@ static efi_status_t efi_disk_add_dev(
|
|||||||
* in this case.
|
* in this case.
|
||||||
*/
|
*/
|
||||||
handle = &diskobj->header;
|
handle = &diskobj->header;
|
||||||
ret = efi_install_multiple_protocol_interfaces(&handle,
|
ret = efi_install_multiple_protocol_interfaces(
|
||||||
&efi_guid_device_path,
|
&handle,
|
||||||
diskobj->dp,
|
&efi_guid_device_path, diskobj->dp,
|
||||||
&efi_block_io_guid,
|
&efi_block_io_guid, &diskobj->ops,
|
||||||
&diskobj->ops, guid,
|
/*
|
||||||
NULL, NULL);
|
* esp_guid must be last entry as it
|
||||||
|
* can be NULL. Its interface is NULL.
|
||||||
|
*/
|
||||||
|
esp_guid, NULL,
|
||||||
|
NULL);
|
||||||
if (ret != EFI_SUCCESS)
|
if (ret != EFI_SUCCESS)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user