1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

efi_loader: use constants in efi_allocate_pages()

Using the existing predefined constants is less error prone and
makes the code easier to read.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Heinrich Schuchardt
2018-01-30 21:08:00 +01:00
committed by Alexander Graf
parent f7c342f413
commit 7c92fd69b1

View File

@@ -292,7 +292,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
uint64_t addr; uint64_t addr;
switch (type) { switch (type) {
case 0: case EFI_ALLOCATE_ANY_PAGES:
/* Any page */ /* Any page */
addr = efi_find_free_memory(len, gd->start_addr_sp); addr = efi_find_free_memory(len, gd->start_addr_sp);
if (!addr) { if (!addr) {
@@ -300,7 +300,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
break; break;
} }
break; break;
case 1: case EFI_ALLOCATE_MAX_ADDRESS:
/* Max address */ /* Max address */
addr = efi_find_free_memory(len, *memory); addr = efi_find_free_memory(len, *memory);
if (!addr) { if (!addr) {
@@ -308,7 +308,7 @@ efi_status_t efi_allocate_pages(int type, int memory_type,
break; break;
} }
break; break;
case 2: case EFI_ALLOCATE_ADDRESS:
/* Exact address, reserve it. The addr is already in *memory. */ /* Exact address, reserve it. The addr is already in *memory. */
addr = *memory; addr = *memory;
break; break;