diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2019-12-24 18:10:21 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-12-25 12:49:24 +0300 |
commit | 47c0fd39b7b81f51cc8f767c34a57d12289bdc60 (patch) | |
tree | 6df49008221920b33cf91c53f07382a88cc97c5d /arch | |
parent | 23e60394046a831d3245f83c0f5d46dee7d83326 (diff) | |
download | linux-47c0fd39b7b81f51cc8f767c34a57d12289bdc60.tar.xz |
efi/libstub: Drop protocol argument from efi_call_proto() macro
After refactoring the mixed mode support code, efi_call_proto()
no longer uses its protocol argument in any of its implementation,
so let's remove it altogether.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Borislav Petkov <bp@alien8.de>
Cc: James Morse <james.morse@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: https://lkml.kernel.org/r/20191224151025.32482-22-ardb@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/efi.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/efi.h | 3 | ||||
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 23 | ||||
-rw-r--r-- | arch/x86/include/asm/efi.h | 6 |
4 files changed, 14 insertions, 21 deletions
diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h index 58e5acc424a0..bdc5288cc643 100644 --- a/arch/arm/include/asm/efi.h +++ b/arch/arm/include/asm/efi.h @@ -57,8 +57,7 @@ void efi_virtmap_unload(void); #define efi_table_attr(table, attr, instance) \ instance->attr -#define efi_call_proto(protocol, f, instance, ...) \ - instance->f(instance, ##__VA_ARGS__) +#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__) struct screen_info *alloc_screen_info(void); void free_screen_info(struct screen_info *si); diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h index d73693177f31..4bc1e89671ab 100644 --- a/arch/arm64/include/asm/efi.h +++ b/arch/arm64/include/asm/efi.h @@ -100,8 +100,7 @@ static inline unsigned long efi_get_max_initrd_addr(unsigned long dram_base, #define efi_table_attr(table, attr, instance) \ instance->attr -#define efi_call_proto(protocol, f, instance, ...) \ - instance->f(instance, ##__VA_ARGS__) +#define efi_call_proto(inst, func, ...) inst->func(inst, ##__VA_ARGS__) #define alloc_screen_info(x...) &screen_info diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index ec92c4decc86..751fd5fc3367 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -69,27 +69,24 @@ preserve_pci_rom_image(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom) rom->pcilen = pci->romsize; *__rom = rom; - status = efi_call_proto(efi_pci_io_protocol, pci.read, pci, - EfiPciIoWidthUint16, PCI_VENDOR_ID, 1, - &rom->vendor); + status = efi_call_proto(pci, pci.read, EfiPciIoWidthUint16, + PCI_VENDOR_ID, 1, &rom->vendor); if (status != EFI_SUCCESS) { efi_printk("Failed to read rom->vendor\n"); goto free_struct; } - status = efi_call_proto(efi_pci_io_protocol, pci.read, pci, - EfiPciIoWidthUint16, PCI_DEVICE_ID, 1, - &rom->devid); + status = efi_call_proto(pci, pci.read, EfiPciIoWidthUint16, + PCI_DEVICE_ID, 1, &rom->devid); if (status != EFI_SUCCESS) { efi_printk("Failed to read rom->devid\n"); goto free_struct; } - status = efi_call_proto(efi_pci_io_protocol, get_location, pci, - &rom->segment, &rom->bus, &rom->device, - &rom->function); + status = efi_call_proto(pci, get_location, &rom->segment, &rom->bus, + &rom->device, &rom->function); if (status != EFI_SUCCESS) goto free_struct; @@ -191,7 +188,7 @@ static void retrieve_apple_device_properties(struct boot_params *boot_params) return; } - efi_call_proto(apple_properties_protocol, get_all, p, NULL, &size); + efi_call_proto(p, get_all, NULL, &size); if (!size) return; @@ -204,8 +201,7 @@ static void retrieve_apple_device_properties(struct boot_params *boot_params) return; } - status = efi_call_proto(apple_properties_protocol, get_all, p, - new->data, &size); + status = efi_call_proto(p, get_all, new->data, &size); if (status == EFI_BUFFER_TOO_SMALL) efi_call_early(free_pool, new); @@ -280,8 +276,7 @@ setup_uga(struct screen_info *si, efi_guid_t *uga_proto, unsigned long size) pciio = NULL; efi_call_early(handle_protocol, handle, &pciio_proto, &pciio); - status = efi_call_proto(efi_uga_draw_protocol, get_mode, uga, - &w, &h, &depth, &refresh); + status = efi_call_proto(uga, get_mode, &w, &h, &depth, &refresh); if (status == EFI_SUCCESS && (!first_uga || pciio)) { width = w; height = h; diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index 1817f350618e..b7cd14e3a634 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h @@ -227,10 +227,10 @@ static inline bool efi_is_native(void) __ret; \ }) -#define efi_call_proto(protocol, f, instance, ...) \ +#define efi_call_proto(inst, func, ...) \ (efi_is_native() \ - ? instance->f(instance, ##__VA_ARGS__) \ - : efi64_thunk(instance->mixed_mode.f, instance, ##__VA_ARGS__)) + ? inst->func(inst, ##__VA_ARGS__) \ + : efi64_thunk(inst->mixed_mode.func, inst, ##__VA_ARGS__)) #define efi_call_early(f, ...) \ (efi_is_native() \ |