Skip to content

Commit 4eb8320

Browse files
committed
efi: Move arch_tables check to caller
Instead of making match_config_table() test its table_types pointer for NULL-ness, omit the call entirely if no arch_tables pointer was provided to efi_config_parse_tables(). Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent 4e9a0f7 commit 4eb8320

File tree

1 file changed

+8
-10
lines changed
  • drivers/firmware/efi

1 file changed

+8
-10
lines changed

drivers/firmware/efi/efi.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,13 @@ static __init int match_config_table(const efi_guid_t *guid,
525525
{
526526
int i;
527527

528-
if (table_types) {
529-
for (i = 0; efi_guidcmp(table_types[i].guid, NULL_GUID); i++) {
530-
if (!efi_guidcmp(*guid, table_types[i].guid)) {
531-
*(table_types[i].ptr) = table;
532-
if (table_types[i].name[0])
533-
pr_cont(" %s=0x%lx ",
534-
table_types[i].name, table);
535-
return 1;
536-
}
528+
for (i = 0; efi_guidcmp(table_types[i].guid, NULL_GUID); i++) {
529+
if (!efi_guidcmp(*guid, table_types[i].guid)) {
530+
*(table_types[i].ptr) = table;
531+
if (table_types[i].name[0])
532+
pr_cont("%s=0x%lx ",
533+
table_types[i].name, table);
534+
return 1;
537535
}
538536
}
539537

@@ -570,7 +568,7 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
570568
table = tbl32[i].table;
571569
}
572570

573-
if (!match_config_table(guid, table, common_tables))
571+
if (!match_config_table(guid, table, common_tables) && arch_tables)
574572
match_config_table(guid, table, arch_tables);
575573
}
576574
pr_cont("\n");

0 commit comments

Comments
 (0)