From 8701863a17fab4726f1c76d7c123033d6e834019 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 15 Jul 2025 16:51:05 +0100 Subject: [efi] Allow compiler to perform type checks on EFI_EVENT As with EFI_HANDLE, the EFI headers define EFI_EVENT as a void pointer, rendering EFI_EVENT compatible with a pointer to itself and hence guaranteeing that pointer type bugs will be introduced. Redefine EFI_EVENT as a pointer to an anonymous structure (as we already do for EFI_HANDLE) to allow the compiler to perform type checking as expected. Signed-off-by: Michael Brown --- src/interface/efi/efi_console.c | 2 +- src/interface/efi/efi_snp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/interface/efi') diff --git a/src/interface/efi/efi_console.c b/src/interface/efi/efi_console.c index 4557671a0..c5a3f24ca 100644 --- a/src/interface/efi/efi_console.c +++ b/src/interface/efi/efi_console.c @@ -387,7 +387,7 @@ static int efi_iskey ( void ) { EFI_BOOT_SERVICES *bs = efi_systab->BootServices; EFI_SIMPLE_TEXT_INPUT_PROTOCOL *conin = efi_systab->ConIn; EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *conin_ex = efi_conin_ex; - EFI_EVENT *event; + EFI_EVENT event; EFI_STATUS efirc; /* If we are mid-sequence, we are always ready */ diff --git a/src/interface/efi/efi_snp.c b/src/interface/efi/efi_snp.c index b9706d5ab..88334c8d0 100644 --- a/src/interface/efi/efi_snp.c +++ b/src/interface/efi/efi_snp.c @@ -175,7 +175,7 @@ static void efi_snp_poll ( struct efi_snp_device *snpdev ) { while ( ( iobuf = netdev_rx_dequeue ( snpdev->netdev ) ) ) { list_add_tail ( &iobuf->list, &snpdev->rx ); snpdev->interrupts |= EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT; - bs->SignalEvent ( &snpdev->snp.WaitForPacket ); + bs->SignalEvent ( snpdev->snp.WaitForPacket ); } } -- cgit v1.2.3-55-g7522