summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/arm-init.c
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-01-22 14:40:57 +0100
committerArd Biesheuvel <ardb@kernel.org>2020-02-23 21:59:42 +0100
commit06c0bd93434c5b9b284773f90bb054aff591d5be (patch)
treee92fb1e0a3943601561e065816450a6a5c916c6f /drivers/firmware/efi/arm-init.c
parent3a0701dc7ff8ebe1031a9f64c99c638929cd2d70 (diff)
downloadlwn-06c0bd93434c5b9b284773f90bb054aff591d5be.tar.gz
lwn-06c0bd93434c5b9b284773f90bb054aff591d5be.zip
efi: Clean up config_parse_tables()
config_parse_tables() is a jumble of pointer arithmetic, due to the fact that on x86, we may be dealing with firmware whose native word size differs from the kernel's. This is not a concern on other architectures, and doesn't quite justify the state of the code, so let's clean it up by adding a non-x86 code path, constifying statically allocated tables and replacing preprocessor conditionals with IS_ENABLED() checks. Tested-by: Tony Luck <tony.luck@intel.com> # arch/ia64 Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware/efi/arm-init.c')
-rw-r--r--drivers/firmware/efi/arm-init.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index a656bfcd7e27..d1f44c847841 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -55,7 +55,7 @@ static phys_addr_t efi_to_phys(unsigned long addr)
static __initdata unsigned long screen_info_table = EFI_INVALID_TABLE_ADDR;
-static __initdata efi_config_table_type_t arch_tables[] = {
+static const efi_config_table_type_t arch_tables[] __initconst = {
{LINUX_EFI_ARM_SCREEN_INFO_TABLE_GUID, NULL, &screen_info_table},
{NULL_GUID, NULL, NULL}
};
@@ -85,7 +85,7 @@ static void __init init_screen_info(void)
static int __init uefi_init(void)
{
- void *config_tables;
+ efi_config_table_t *config_tables;
size_t table_size;
int retval;
@@ -118,7 +118,6 @@ static int __init uefi_init(void)
goto out;
}
retval = efi_config_parse_tables(config_tables, efi.systab->nr_tables,
- sizeof(efi_config_table_t),
arch_tables);
if (!retval)