lmb: Remove lmb_alloc_flags()

lmb_alloc_flags() & lmb_alloc_base_flags() are just a wrappers for
_lmb_alloc_base(). Since the only difference is the max address of the
allowed allocation which _lmb_alloc_base() already supports with the
LMB_ALLOC_ANYWHERE flag, remove one of them.

Keep the lmb_alloc_base_flags() which also prints an error on failures
and adjust efi_allocate_pages() to only use one of them.

While at it clean up the duplicate function description from the header
file.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Ilias Apalodimas
2024-10-23 18:26:36 +03:00
committed by Tom Rini
parent f6fb6a8851
commit ede2361998
3 changed files with 5 additions and 47 deletions

View File

@@ -14,6 +14,9 @@
* Copyright (C) 2001 Peter Bergner, IBM Corp.
*/
#define LMB_ALLOC_ANYWHERE 0
#define LMB_ALIST_INITIAL_SIZE 4
/**
* enum lmb_flags - definition of memory region attributes
* @LMB_NONE: no special request
@@ -95,32 +98,6 @@ phys_addr_t lmb_alloc_base(phys_size_t size, ulong align, phys_addr_t max_addr);
phys_addr_t lmb_alloc_addr(phys_addr_t base, phys_size_t size);
phys_size_t lmb_get_free_size(phys_addr_t addr);
/**
* lmb_alloc_flags() - Allocate memory region with specified attributes
* @size: Size of the region requested
* @align: Alignment of the memory region requested
* @flags: Memory region attributes to be set
*
* Allocate a region of memory with the attributes specified through the
* parameter.
*
* Return: base address on success, 0 on error
*/
phys_addr_t lmb_alloc_flags(phys_size_t size, ulong align, uint flags);
/**
* lmb_alloc_base_flags() - Allocate specified memory region with specified attributes
* @size: Size of the region requested
* @align: Alignment of the memory region requested
* @max_addr: Maximum address of the requested region
* @flags: Memory region attributes to be set
*
* Allocate a region of memory with the attributes specified through the
* parameter. The max_addr parameter is used to specify the maximum address
* below which the requested region should be allocated.
*
* Return: base address on success, 0 on error
*/
phys_addr_t lmb_alloc_base_flags(phys_size_t size, ulong align,
phys_addr_t max_addr, uint flags);