alist: add a helper to check if the list is full

Add a helper function to check if the alist is full. This can then be
used to extend the alist.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Sughosh Ganu 2024-08-26 17:29:14 +05:30 committed by Tom Rini
parent 30e331e9cb
commit c4eced2ec0

View file

@ -82,6 +82,17 @@ static inline bool alist_err(struct alist *lst)
return lst->flags & ALISTF_FAIL; return lst->flags & ALISTF_FAIL;
} }
/**
* alist_full() - Check if the alist is full
*
* @lst: List to check
* Return: true if full, false otherwise
*/
static inline bool alist_full(struct alist *lst)
{
return lst->count == lst->alloc;
}
/** /**
* alist_get_ptr() - Get the value of a pointer * alist_get_ptr() - Get the value of a pointer
* *