mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
efi/fdt: Simplify the get_fdt() flow
Reorganize the get_fdt() lookup loop, clearly showing that: - Nothing is done for table entries that do not have fdt_guid - Once an entry with fdt_guid is found, break out of the loop No functional changes. Suggested-by: Joe Perches <[email protected]> Signed-off-by: Julien Thierry <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Arend van Spriel <[email protected]> Cc: Bhupesh Sharma <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Eric Snowberg <[email protected]> Cc: Hans de Goede <[email protected]> Cc: Jon Hunter <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Sai Praneeth Prakhya <[email protected]> Cc: Sedat Dilek <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: YiFei Zhu <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
6935b3c43d
commit
8c25db0a5a
1 changed files with 13 additions and 12 deletions
|
|
@ -370,23 +370,24 @@ void *get_fdt(efi_system_table_t *sys_table, unsigned long *fdt_size)
|
|||
{
|
||||
efi_guid_t fdt_guid = DEVICE_TREE_GUID;
|
||||
efi_config_table_t *tables;
|
||||
void *fdt;
|
||||
int i;
|
||||
|
||||
tables = (efi_config_table_t *) sys_table->tables;
|
||||
fdt = NULL;
|
||||
tables = (efi_config_table_t *)sys_table->tables;
|
||||
|
||||
for (i = 0; i < sys_table->nr_tables; i++) {
|
||||
if (efi_guidcmp(tables[i].guid, fdt_guid) == 0) {
|
||||
fdt = (void *) tables[i].table;
|
||||
if (fdt_check_header(fdt) != 0) {
|
||||
pr_efi_err(sys_table, "Invalid header detected on UEFI supplied FDT, ignoring ...\n");
|
||||
return NULL;
|
||||
}
|
||||
*fdt_size = fdt_totalsize(fdt);
|
||||
break;
|
||||
void *fdt;
|
||||
|
||||
if (efi_guidcmp(tables[i].guid, fdt_guid) != 0)
|
||||
continue;
|
||||
|
||||
fdt = (void *)tables[i].table;
|
||||
if (fdt_check_header(fdt) != 0) {
|
||||
pr_efi_err(sys_table, "Invalid header detected on UEFI supplied FDT, ignoring ...\n");
|
||||
return NULL;
|
||||
}
|
||||
*fdt_size = fdt_totalsize(fdt);
|
||||
return fdt;
|
||||
}
|
||||
|
||||
return fdt;
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue