Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 -18
+1 -17
arch/x86/platform/efi/efi.c
··· 76 76 {NULL_GUID, NULL, NULL}, 77 77 }; 78 78 79 - static void *efi_runtime_map; 80 - static int nr_efi_runtime_map; 81 79 u64 efi_setup; /* efi setup_data physical address */ 82 - u32 efi_data_len; /* efi setup_data payload length */ 83 80 84 81 /* 85 82 * Returns 1 if 'facility' is enabled, 0 otherwise. ··· 699 702 return ret; 700 703 } 701 704 702 - static void get_nr_runtime_map(void) 703 - { 704 - if (!efi_setup) 705 - return; 706 - 707 - nr_efi_runtime_map = (efi_data_len - sizeof(struct efi_setup_data)) / 708 - sizeof(efi_memory_desc_t); 709 - } 710 - 711 705 void __init efi_init(void) 712 706 { 713 707 efi_char16_t *c16; ··· 706 718 int i = 0; 707 719 void *tmp; 708 720 709 - get_nr_runtime_map(); 710 721 #ifdef CONFIG_X86_32 711 722 if (boot_params.efi_info.efi_systab_hi || 712 723 boot_params.efi_info.efi_memmap_hi) { ··· 920 933 count++; 921 934 } 922 935 923 - efi_runtime_map = q; 924 - nr_efi_runtime_map = count; 925 - efi_runtime_map_setup(efi_runtime_map, nr_efi_runtime_map, 926 - boot_params.efi_info.efi_memdesc_size); 936 + efi_runtime_map_setup(q, count, memmap.desc_size); 927 937 928 938 return 0; 929 939 out:
-1
arch/x86/platform/efi/efi_64.c
··· 232 232 void __init parse_efi_setup(u64 phys_addr, u32 data_len) 233 233 { 234 234 efi_setup = phys_addr + sizeof(struct setup_data); 235 - efi_data_len = data_len - sizeof(struct setup_data); 236 235 }