x86, efi: Cleanup config table walking
Trivial cleanup, move guid and table pointers to local copies to make the code cleaner. Signed-off-by: Olof Johansson <olof@lixom.net> Link: http://lkml.kernel.org/r/1329081869-20779-4-git-send-email-olof@lixom.net Acked-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
committed by
H. Peter Anvin
parent
e3cb3f5a35
commit
a6a46f415d
@@ -455,53 +455,48 @@ static void __init efi_systab_init(void *phys)
|
|||||||
static void __init efi_config_init(u64 tables, int nr_tables)
|
static void __init efi_config_init(u64 tables, int nr_tables)
|
||||||
{
|
{
|
||||||
efi_config_table_t *config_tables;
|
efi_config_table_t *config_tables;
|
||||||
int i;
|
int i, sz = sizeof(efi_config_table_t);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Let's see what config tables the firmware passed to us.
|
* Let's see what config tables the firmware passed to us.
|
||||||
*/
|
*/
|
||||||
config_tables = early_ioremap(
|
config_tables = early_ioremap(efi.systab->tables,
|
||||||
efi.systab->tables,
|
efi.systab->nr_tables * sz);
|
||||||
efi.systab->nr_tables * sizeof(efi_config_table_t));
|
|
||||||
if (config_tables == NULL)
|
if (config_tables == NULL)
|
||||||
pr_err("Could not map Configuration table!\n");
|
pr_err("Could not map Configuration table!\n");
|
||||||
|
|
||||||
pr_info("");
|
pr_info("");
|
||||||
for (i = 0; i < efi.systab->nr_tables; i++) {
|
for (i = 0; i < efi.systab->nr_tables; i++) {
|
||||||
if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) {
|
efi_guid_t guid = config_tables[i].guid;
|
||||||
efi.mps = config_tables[i].table;
|
unsigned long table = config_tables[i].table;
|
||||||
pr_cont(" MPS=0x%lx ", config_tables[i].table);
|
|
||||||
} else if (!efi_guidcmp(config_tables[i].guid,
|
if (!efi_guidcmp(guid, MPS_TABLE_GUID)) {
|
||||||
ACPI_20_TABLE_GUID)) {
|
efi.mps = table;
|
||||||
efi.acpi20 = config_tables[i].table;
|
pr_cont(" MPS=0x%lx ", table);
|
||||||
pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table);
|
} else if (!efi_guidcmp(guid, ACPI_20_TABLE_GUID)) {
|
||||||
} else if (!efi_guidcmp(config_tables[i].guid,
|
efi.acpi20 = table;
|
||||||
ACPI_TABLE_GUID)) {
|
pr_cont(" ACPI 2.0=0x%lx ", table);
|
||||||
efi.acpi = config_tables[i].table;
|
} else if (!efi_guidcmp(guid, ACPI_TABLE_GUID)) {
|
||||||
pr_cont(" ACPI=0x%lx ", config_tables[i].table);
|
efi.acpi = table;
|
||||||
} else if (!efi_guidcmp(config_tables[i].guid,
|
pr_cont(" ACPI=0x%lx ", table);
|
||||||
SMBIOS_TABLE_GUID)) {
|
} else if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) {
|
||||||
efi.smbios = config_tables[i].table;
|
efi.smbios = table;
|
||||||
pr_cont(" SMBIOS=0x%lx ", config_tables[i].table);
|
pr_cont(" SMBIOS=0x%lx ", table);
|
||||||
#ifdef CONFIG_X86_UV
|
#ifdef CONFIG_X86_UV
|
||||||
} else if (!efi_guidcmp(config_tables[i].guid,
|
} else if (!efi_guidcmp(guid, UV_SYSTEM_TABLE_GUID)) {
|
||||||
UV_SYSTEM_TABLE_GUID)) {
|
efi.uv_systab = table;
|
||||||
efi.uv_systab = config_tables[i].table;
|
pr_cont(" UVsystab=0x%lx ", table);
|
||||||
pr_cont(" UVsystab=0x%lx ", config_tables[i].table);
|
|
||||||
#endif
|
#endif
|
||||||
} else if (!efi_guidcmp(config_tables[i].guid,
|
} else if (!efi_guidcmp(guid, HCDP_TABLE_GUID)) {
|
||||||
HCDP_TABLE_GUID)) {
|
efi.hcdp = table;
|
||||||
efi.hcdp = config_tables[i].table;
|
pr_cont(" HCDP=0x%lx ", table);
|
||||||
pr_cont(" HCDP=0x%lx ", config_tables[i].table);
|
} else if (!efi_guidcmp(guid, UGA_IO_PROTOCOL_GUID)) {
|
||||||
} else if (!efi_guidcmp(config_tables[i].guid,
|
efi.uga = table;
|
||||||
UGA_IO_PROTOCOL_GUID)) {
|
pr_cont(" UGA=0x%lx ", table);
|
||||||
efi.uga = config_tables[i].table;
|
|
||||||
pr_cont(" UGA=0x%lx ", config_tables[i].table);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pr_cont("\n");
|
pr_cont("\n");
|
||||||
early_iounmap(config_tables,
|
early_iounmap(config_tables, efi.systab->nr_tables * sz);
|
||||||
efi.systab->nr_tables * sizeof(efi_config_table_t));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init efi_runtime_init(void)
|
static void __init efi_runtime_init(void)
|
||||||
|
Reference in New Issue
Block a user