lmb: Improve kernel-doc comments

Fix warnings from kernel-doc script. Improve and unify overall style of
kernel-doc comments in lmb source files. Move all kernel-doc comments
for public functions into the header, as recommended in U-Boot
documentation [1]:

    Non-trivial functions should have a comment which describes what
    they do. If it is an exported function, put the comment in the
    header file so the API is in one place. If it is a static function,
    put it in the C file.

This also takes care of existing duplication. While at it, do a bit of
cosmetic cleanups as well.

No functional change.

[1] doc/develop/codingstyle.rst

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
(cherry picked from commit 22db5b2137)
Added back #if CONFIG_IS_ENABLED(LMB) guard:
Signed-off-by: Simon Glass <simon.glass@canonical.com>
This commit is contained in:
Sam Protsenko
2024-12-10 20:25:50 -06:00
committed by Simon Glass
parent c454a6ddb0
commit 2a47acca5b
2 changed files with 73 additions and 107 deletions

View File

@@ -598,14 +598,6 @@ static __maybe_unused void lmb_reserve_common_spl(void)
}
}
/**
* lmb_add_memory() - Add memory range for LMB allocations
*
* Add the entire available memory range to the pool of memory that
* can be used by the LMB module for allocations.
*
* Return: None
*/
void lmb_add_memory(void)
{
int i;
@@ -662,16 +654,6 @@ long lmb_add(phys_addr_t base, phys_size_t size)
return lmb_map_update_notify(base, size, MAP_OP_ADD, LMB_NONE);
}
/**
* lmb_free_flags() - Free up a region of memory
* @base: Base Address of region to be freed
* @size: Size of the region to be freed
* @flags: Memory region attributes
*
* Free up a region of memory.
*
* Return: 0 if successful, negative error code on failure
*/
long lmb_free_flags(phys_addr_t base, phys_size_t size,
uint flags)
{
@@ -779,19 +761,6 @@ phys_addr_t lmb_alloc_base(phys_size_t size, ulong align, phys_addr_t max_addr)
return alloc;
}
/**
* 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)
{
@@ -840,18 +809,6 @@ phys_addr_t lmb_alloc_addr(phys_addr_t base, phys_size_t size)
return _lmb_alloc_addr(base, size, LMB_NONE);
}
/**
* lmb_alloc_addr_flags() - Allocate specified memory address with specified attributes
* @base: Base Address requested
* @size: Size of the region requested
* @flags: Memory region attributes to be set
*
* Allocate a region of memory with the attributes specified through the
* parameter. The base parameter is used to specify the base address
* of the requested region.
*
* Return: base address on success, 0 on error
*/
phys_addr_t lmb_alloc_addr_flags(phys_addr_t base, phys_size_t size,
uint flags)
{
@@ -924,18 +881,6 @@ static int lmb_setup(bool test)
return 0;
}
/**
* lmb_init() - Initialise the LMB module
*
* Initialise the LMB lists needed for keeping the memory map. There
* are two lists, in form of alloced list data structure. One for the
* available memory, and one for the used memory. Initialise the two
* lists as part of board init. Add memory to the available memory
* list and reserve common areas by adding them to the used memory
* list.
*
* Return: 0 on success, -ve on error
*/
int lmb_init(void)
{
int ret;