Skip to content

Commit 518548a

Browse files
author
Matt Fleming
committed
x86/efi: Delete superfluous global variables
There's no need to save the runtime map details in global variables, the values are only required to pass to efi_runtime_map_setup(). And because 'nr_efi_runtime_map' isn't needed, get_nr_runtime_map() can be deleted along with 'efi_data_len'. Cc: Dave Young <dyoung@redhat.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
1 parent 77ea8c9 commit 518548a

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

arch/x86/platform/efi/efi.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,7 @@ static __initdata efi_config_table_type_t arch_tables[] = {
7676
{NULL_GUID, NULL, NULL},
7777
};
7878

79-
static void *efi_runtime_map;
80-
static int nr_efi_runtime_map;
8179
u64 efi_setup; /* efi setup_data physical address */
82-
u32 efi_data_len; /* efi setup_data payload length */
8380

8481
/*
8582
* Returns 1 if 'facility' is enabled, 0 otherwise.
@@ -702,23 +699,13 @@ static int __init efi_reuse_config(u64 tables, int nr_tables)
702699
return ret;
703700
}
704701

705-
static void get_nr_runtime_map(void)
706-
{
707-
if (!efi_setup)
708-
return;
709-
710-
nr_efi_runtime_map = (efi_data_len - sizeof(struct efi_setup_data)) /
711-
sizeof(efi_memory_desc_t);
712-
}
713-
714702
void __init efi_init(void)
715703
{
716704
efi_char16_t *c16;
717705
char vendor[100] = "unknown";
718706
int i = 0;
719707
void *tmp;
720708

721-
get_nr_runtime_map();
722709
#ifdef CONFIG_X86_32
723710
if (boot_params.efi_info.efi_systab_hi ||
724711
boot_params.efi_info.efi_memmap_hi) {
@@ -933,10 +920,7 @@ static int __init save_runtime_map(void)
933920
count++;
934921
}
935922

936-
efi_runtime_map = q;
937-
nr_efi_runtime_map = count;
938-
efi_runtime_map_setup(efi_runtime_map, nr_efi_runtime_map,
939-
boot_params.efi_info.efi_memdesc_size);
923+
efi_runtime_map_setup(q, count, memmap.desc_size);
940924

941925
return 0;
942926
out:

arch/x86/platform/efi/efi_64.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,4 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
232232
void __init parse_efi_setup(u64 phys_addr, u32 data_len)
233233
{
234234
efi_setup = phys_addr + sizeof(struct setup_data);
235-
efi_data_len = data_len - sizeof(struct setup_data);
236235
}

0 commit comments

Comments
 (0)