From 32a9408217810498deeeae3d2564ab15468c9c39 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 24 Mar 2025 14:24:47 +0000 Subject: [efi] Allow use of typed pointers for efi_open() et al Provide wrapper macros to allow efi_open() and related functions to accept a pointer to any pointer type as the "interface" argument, in order to allow a substantial amount of type adjustment boilerplate to be removed. Signed-off-by: Michael Brown --- src/interface/efi/efi_init.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/interface/efi/efi_init.c') diff --git a/src/interface/efi/efi_init.c b/src/interface/efi/efi_init.c index 03506ec5c..1ba144ee7 100644 --- a/src/interface/efi/efi_init.c +++ b/src/interface/efi/efi_init.c @@ -173,8 +173,7 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, EFI_BOOT_SERVICES *bs; struct efi_protocol *prot; struct efi_config_table *tab; - void *loaded_image; - void *device_path; + EFI_DEVICE_PATH_PROTOCOL *device_path; void *device_path_copy; size_t device_path_len; EFI_STATUS efirc; @@ -248,13 +247,12 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle, */ if ( ( rc = efi_open_unsafe ( image_handle, &efi_loaded_image_protocol_guid, - &loaded_image ) ) != 0 ) { + &efi_loaded_image ) ) != 0 ) { DBGC ( systab, "EFI could not get loaded image protocol: %s", strerror ( rc ) ); efirc = EFIRC ( rc ); goto err_no_loaded_image; } - efi_loaded_image = loaded_image; DBGC ( systab, "EFI image base address %p\n", efi_loaded_image->ImageBase ); -- cgit v1.2.3-55-g7522