Commit 6d2576e4 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Ard Biesheuvel

efi/esrt: Clean up efi_esrt_init

Remove an unused variable in __init efi_esrt_init().
Simplify a logical constraint.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Link: https://lore.kernel.org/r/20200223204557.114634-1-xypron.glpk@gmx.deSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent f01dd5b3
...@@ -240,7 +240,6 @@ void __init efi_esrt_init(void) ...@@ -240,7 +240,6 @@ void __init efi_esrt_init(void)
{ {
void *va; void *va;
struct efi_system_resource_table tmpesrt; struct efi_system_resource_table tmpesrt;
struct efi_system_resource_entry_v1 *v1_entries;
size_t size, max, entry_size, entries_size; size_t size, max, entry_size, entries_size;
efi_memory_desc_t md; efi_memory_desc_t md;
int rc; int rc;
...@@ -288,14 +287,13 @@ void __init efi_esrt_init(void) ...@@ -288,14 +287,13 @@ void __init efi_esrt_init(void)
memcpy(&tmpesrt, va, sizeof(tmpesrt)); memcpy(&tmpesrt, va, sizeof(tmpesrt));
early_memunmap(va, size); early_memunmap(va, size);
if (tmpesrt.fw_resource_version == 1) { if (tmpesrt.fw_resource_version != 1) {
entry_size = sizeof (*v1_entries);
} else {
pr_err("Unsupported ESRT version %lld.\n", pr_err("Unsupported ESRT version %lld.\n",
tmpesrt.fw_resource_version); tmpesrt.fw_resource_version);
return; return;
} }
entry_size = sizeof(struct efi_system_resource_entry_v1);
if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) { if (tmpesrt.fw_resource_count > 0 && max - size < entry_size) {
pr_err("ESRT memory map entry can only hold the header. (max: %zu size: %zu)\n", pr_err("ESRT memory map entry can only hold the header. (max: %zu size: %zu)\n",
max - size, entry_size); max - size, entry_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment