diff mbox series

[U-Boot,1/1] efi_loader: use constants in efi_allocate_pages()

Message ID 20180130200800.24818-1-xypron.glpk@gmx.de
State Accepted
Commit 7c92fd69b19bf4bfdc7c3fa74c504b66019004f0
Delegated to: Alexander Graf
Headers show
Series [U-Boot,1/1] efi_loader: use constants in efi_allocate_pages() | expand

Commit Message

Heinrich Schuchardt Jan. 30, 2018, 8:08 p.m. UTC
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>
---
 lib/efi_loader/efi_memory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index bee0a0c97d..e967e190c8 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -295,7 +295,7 @@  efi_status_t efi_allocate_pages(int type, int memory_type,
 	uint64_t addr;
 
 	switch (type) {
-	case 0:
+	case EFI_ALLOCATE_ANY_PAGES:
 		/* Any page */
 		addr = efi_find_free_memory(len, gd->start_addr_sp);
 		if (!addr) {
@@ -303,7 +303,7 @@  efi_status_t efi_allocate_pages(int type, int memory_type,
 			break;
 		}
 		break;
-	case 1:
+	case EFI_ALLOCATE_MAX_ADDRESS:
 		/* Max address */
 		addr = efi_find_free_memory(len, *memory);
 		if (!addr) {
@@ -311,7 +311,7 @@  efi_status_t efi_allocate_pages(int type, int memory_type,
 			break;
 		}
 		break;
-	case 2:
+	case EFI_ALLOCATE_ADDRESS:
 		/* Exact address, reserve it. The addr is already in *memory. */
 		addr = *memory;
 		break;