diff options
author | Olof Johansson <olof@lixom.net> | 2012-02-12 16:24:27 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-23 21:54:33 -0500 |
commit | a6a46f415dca828a04a435ca1f67de0bc5b9ae30 (patch) | |
tree | 4a80f43c1f772e097769e836276c68bbc4da5cfb /arch/x86/platform | |
parent | e3cb3f5a35997906f9b79bf860029c02a54cfae6 (diff) |
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>
Diffstat (limited to 'arch/x86/platform')
-rw-r--r-- | arch/x86/platform/efi/efi.c | 61 |
1 files changed, 28 insertions, 33 deletions
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index 511fb15e203..03259d1df14 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -455,53 +455,48 @@ static void __init efi_systab_init(void *phys) | |||
455 | static void __init efi_config_init(u64 tables, int nr_tables) | 455 | static void __init efi_config_init(u64 tables, int nr_tables) |
456 | { | 456 | { |
457 | efi_config_table_t *config_tables; | 457 | efi_config_table_t *config_tables; |
458 | int i; | 458 | int i, sz = sizeof(efi_config_table_t); |
459 | 459 | ||
460 | /* | 460 | /* |
461 | * Let's see what config tables the firmware passed to us. | 461 | * Let's see what config tables the firmware passed to us. |
462 | */ | 462 | */ |
463 | config_tables = early_ioremap( | 463 | config_tables = early_ioremap(efi.systab->tables, |
464 | efi.systab->tables, | 464 | efi.systab->nr_tables * sz); |
465 | efi.systab->nr_tables * sizeof(efi_config_table_t)); | ||
466 | if (config_tables == NULL) | 465 | if (config_tables == NULL) |
467 | pr_err("Could not map Configuration table!\n"); | 466 | pr_err("Could not map Configuration table!\n"); |
468 | 467 | ||
469 | pr_info(""); | 468 | pr_info(""); |
470 | for (i = 0; i < efi.systab->nr_tables; i++) { | 469 | for (i = 0; i < efi.systab->nr_tables; i++) { |
471 | if (!efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID)) { | 470 | efi_guid_t guid = config_tables[i].guid; |
472 | efi.mps = config_tables[i].table; | 471 | unsigned long table = config_tables[i].table; |
473 | pr_cont(" MPS=0x%lx ", config_tables[i].table); | 472 | |
474 | } else if (!efi_guidcmp(config_tables[i].guid, | 473 | if (!efi_guidcmp(guid, MPS_TABLE_GUID)) { |
475 | ACPI_20_TABLE_GUID)) { | 474 | efi.mps = table; |
476 | efi.acpi20 = config_tables[i].table; | 475 | pr_cont(" MPS=0x%lx ", table); |
477 | pr_cont(" ACPI 2.0=0x%lx ", config_tables[i].table); | 476 | } else if (!efi_guidcmp(guid, ACPI_20_TABLE_GUID)) { |
478 | } else if (!efi_guidcmp(config_tables[i].guid, | 477 | efi.acpi20 = table; |
479 | ACPI_TABLE_GUID)) { | 478 | pr_cont(" ACPI 2.0=0x%lx ", table); |
480 | efi.acpi = config_tables[i].table; | 479 | } else if (!efi_guidcmp(guid, ACPI_TABLE_GUID)) { |
481 | pr_cont(" ACPI=0x%lx ", config_tables[i].table); | 480 | efi.acpi = table; |
482 | } else if (!efi_guidcmp(config_tables[i].guid, | 481 | pr_cont(" ACPI=0x%lx ", table); |
483 | SMBIOS_TABLE_GUID)) { | 482 | } else if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID)) { |
484 | efi.smbios = config_tables[i].table; | 483 | efi.smbios = table; |
485 | pr_cont(" SMBIOS=0x%lx ", config_tables[i].table); | 484 | pr_cont(" SMBIOS=0x%lx ", table); |
486 | #ifdef CONFIG_X86_UV | 485 | #ifdef CONFIG_X86_UV |
487 | } else if (!efi_guidcmp(config_tables[i].guid, | 486 | } else if (!efi_guidcmp(guid, UV_SYSTEM_TABLE_GUID)) { |
488 | UV_SYSTEM_TABLE_GUID)) { | 487 | efi.uv_systab = table; |
489 | efi.uv_systab = config_tables[i].table; | 488 | pr_cont(" UVsystab=0x%lx ", table); |
490 | pr_cont(" UVsystab=0x%lx ", config_tables[i].table); | ||
491 | #endif | 489 | #endif |
492 | } else if (!efi_guidcmp(config_tables[i].guid, | 490 | } else if (!efi_guidcmp(guid, HCDP_TABLE_GUID)) { |
493 | HCDP_TABLE_GUID)) { | 491 | efi.hcdp = table; |
494 | efi.hcdp = config_tables[i].table; | 492 | pr_cont(" HCDP=0x%lx ", table); |
495 | pr_cont(" HCDP=0x%lx ", config_tables[i].table); | 493 | } else if (!efi_guidcmp(guid, UGA_IO_PROTOCOL_GUID)) { |
496 | } else if (!efi_guidcmp(config_tables[i].guid, | 494 | efi.uga = table; |
497 | UGA_IO_PROTOCOL_GUID)) { | 495 | pr_cont(" UGA=0x%lx ", table); |
498 | efi.uga = config_tables[i].table; | ||
499 | pr_cont(" UGA=0x%lx ", config_tables[i].table); | ||
500 | } | 496 | } |
501 | } | 497 | } |
502 | pr_cont("\n"); | 498 | pr_cont("\n"); |
503 | early_iounmap(config_tables, | 499 | early_iounmap(config_tables, efi.systab->nr_tables * sz); |
504 | efi.systab->nr_tables * sizeof(efi_config_table_t)); | ||
505 | } | 500 | } |
506 | 501 | ||
507 | static void __init efi_runtime_init(void) | 502 | static void __init efi_runtime_init(void) |