diff options
author | Michael Brown <mcb30@ipxe.org> | 2014-07-31 12:22:40 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2014-07-31 12:50:09 +0100 |
commit | 4a480f1d1565aa5972c4fc27ceec8ae4b9b1e86c (patch) | |
tree | 7d6cc53d78cc711330425810dd78320ab5aaaf81 /src/interface | |
parent | 88bd71a27abb658a2ac12b54ed78c5cfd4c99f53 (diff) | |
download | ipxe-4a480f1d1565aa5972c4fc27ceec8ae4b9b1e86c.tar.gz |
[efi] Avoid unnecessarily passing pointers to EFI_HANDLEs
efi_file_install() and efi_download_install() are both used to install
onto existing handles. There is therefore no need to allow for each
of their calls to InstallMultipleProtocolInterfaces() to create a new
handle.
By passing the handle directly (rather than a pointer to the handle),
we avoid potential confusion (and erroneous debug message colours).
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface')
-rw-r--r-- | src/interface/efi/efi_download.c | 4 | ||||
-rw-r--r-- | src/interface/efi/efi_file.c | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/interface/efi/efi_download.c b/src/interface/efi/efi_download.c index 522276ac..1218852e 100644 --- a/src/interface/efi/efi_download.c +++ b/src/interface/efi/efi_download.c @@ -205,13 +205,13 @@ static IPXE_DOWNLOAD_PROTOCOL ipxe_download_protocol_interface = { * @v handle EFI handle * @ret rc Return status code */ -int efi_download_install ( EFI_HANDLE *handle ) { +int efi_download_install ( EFI_HANDLE handle ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; EFI_STATUS efirc; int rc; efirc = bs->InstallMultipleProtocolInterfaces ( - handle, + &handle, &ipxe_download_protocol_guid, &ipxe_download_protocol_interface, NULL ); diff --git a/src/interface/efi/efi_file.c b/src/interface/efi/efi_file.c index f8713750..aafc781a 100644 --- a/src/interface/efi/efi_file.c +++ b/src/interface/efi/efi_file.c @@ -575,7 +575,7 @@ static EFI_DISK_IO_PROTOCOL efi_disk_io_protocol = { * @v handle EFI handle * @ret rc Return status code */ -int efi_file_install ( EFI_HANDLE *handle ) { +int efi_file_install ( EFI_HANDLE handle ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; union { EFI_DISK_IO_PROTOCOL *diskio; @@ -592,7 +592,7 @@ int efi_file_install ( EFI_HANDLE *handle ) { * handle just to keep things looking normal. */ if ( ( efirc = bs->InstallMultipleProtocolInterfaces ( - handle, + &handle, &efi_block_io_protocol_guid, &efi_block_io_protocol, &efi_disk_io_protocol_guid, @@ -624,9 +624,9 @@ int efi_file_install ( EFI_HANDLE *handle ) { * of calls to our DRIVER_STOP method when starting the EFI * shell. I have no idea why this is. */ - if ( ( efirc = bs->OpenProtocol ( *handle, &efi_disk_io_protocol_guid, + if ( ( efirc = bs->OpenProtocol ( handle, &efi_disk_io_protocol_guid, &diskio.interface, efi_image_handle, - *handle, + handle, EFI_OPEN_PROTOCOL_BY_DRIVER ) ) != 0){ rc = -EEFI ( efirc ); DBGC ( handle, "Could not open disk I/O protocol: %s\n", @@ -637,11 +637,11 @@ int efi_file_install ( EFI_HANDLE *handle ) { return 0; - bs->CloseProtocol ( *handle, &efi_disk_io_protocol_guid, - efi_image_handle, *handle ); + bs->CloseProtocol ( handle, &efi_disk_io_protocol_guid, + efi_image_handle, handle ); err_open: bs->UninstallMultipleProtocolInterfaces ( - *handle, + handle, &efi_simple_file_system_protocol_guid, &efi_simple_file_system_protocol, &efi_disk_io_protocol_guid, |