From 7c92fd69b19bf4bfdc7c3fa74c504b66019004f0 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 30 Jan 2018 21:08:00 +0100 Subject: 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 Signed-off-by: Alexander Graf --- lib/efi_loader/efi_memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/efi_loader/efi_memory.c') diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index ff0edf30ffb..1e413d01cb9 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -292,7 +292,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) { @@ -300,7 +300,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) { @@ -308,7 +308,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; -- cgit v1.2.3 From bdecaebd5d5e266301b4bc4064b5fbc0922874d2 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 8 Mar 2018 21:53:27 +0100 Subject: efi: Correct header order in efi_memory The headers are not in the correct order. Fix this. Also drop libfdt_env.h since it is not needed. Signed-off-by: Simon Glass Rebased Reviewed-by: Heinrich Schuchardt Signed-off-by: Alexander Graf --- lib/efi_loader/efi_memory.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/efi_loader/efi_memory.c') diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 1e413d01cb9..95f9ff0a140 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -8,12 +8,11 @@ #include #include +#include #include +#include #include -#include #include -#include -#include DECLARE_GLOBAL_DATA_PTR; -- cgit v1.2.3