efi_loader: typedef struct efi_object *efi_handle_t
All our handles point to a struct efi_object. So let's define the
efi_handle_t accordingly. This helps us to discover coding errors much
more easily. This becomes evident by the corrections to the usage of
handles in this patch.
Rename variable image_handle to image_obj where applicable.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
diff --git a/lib/efi/efi.c b/lib/efi/efi.c
index c6639f9..2c6a508 100644
--- a/lib/efi/efi.c
+++ b/lib/efi/efi.c
@@ -69,7 +69,7 @@
efi_putc(priv, ' ');
ret = boot->open_protocol(priv->parent_image, &loaded_image_guid,
- (void **)&loaded_image, &priv->parent_image,
+ (void **)&loaded_image, priv->parent_image,
NULL, EFI_OPEN_PROTOCOL_GET_PROTOCOL);
if (ret) {
efi_puts(priv, "Failed to get loaded image protocol\n");
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 9440816..917d229 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1019,7 +1019,7 @@
* Return: status code
*/
static efi_status_t EFIAPI efi_install_protocol_interface(
- void **handle, const efi_guid_t *protocol,
+ efi_handle_t *handle, const efi_guid_t *protocol,
int protocol_interface_type, void *protocol_interface)
{
efi_status_t r;
@@ -2309,8 +2309,8 @@
*
* Return: status code
*/
-static efi_status_t EFIAPI efi_install_multiple_protocol_interfaces(
- void **handle, ...)
+static efi_status_t EFIAPI efi_install_multiple_protocol_interfaces
+ (efi_handle_t *handle, ...)
{
EFI_ENTRY("%p", handle);
@@ -2346,7 +2346,7 @@
for (; i; --i) {
protocol = efi_va_arg(argptr, efi_guid_t*);
protocol_interface = efi_va_arg(argptr, void*);
- EFI_CALL(efi_uninstall_protocol_interface(handle, protocol,
+ EFI_CALL(efi_uninstall_protocol_interface(*handle, protocol,
protocol_interface));
}
efi_va_end(argptr);
@@ -2369,7 +2369,7 @@
* Return: status code
*/
static efi_status_t EFIAPI efi_uninstall_multiple_protocol_interfaces(
- void *handle, ...)
+ efi_handle_t handle, ...)
{
EFI_ENTRY("%p", handle);
@@ -2588,10 +2588,10 @@
*
* Return: status code
*/
-static efi_status_t EFIAPI efi_open_protocol(
- void *handle, const efi_guid_t *protocol,
- void **protocol_interface, void *agent_handle,
- void *controller_handle, uint32_t attributes)
+static efi_status_t EFIAPI efi_open_protocol
+ (efi_handle_t handle, const efi_guid_t *protocol,
+ void **protocol_interface, efi_handle_t agent_handle,
+ efi_handle_t controller_handle, uint32_t attributes)
{
struct efi_handler *handler;
efi_status_t r = EFI_INVALID_PARAMETER;
diff --git a/lib/efi_selftest/efi_selftest_devicepath.c b/lib/efi_selftest/efi_selftest_devicepath.c
index adcf531..105ce2c 100644
--- a/lib/efi_selftest/efi_selftest_devicepath.c
+++ b/lib/efi_selftest/efi_selftest_devicepath.c
@@ -257,7 +257,7 @@
static int execute(void)
{
struct efi_device_path *remaining_dp;
- void *handle;
+ efi_handle_t handle;
/*
* This device path node ends with the letter 't' of 'u-boot'.
* The following '.bin' does not belong to the node but is