summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSughosh Ganu <sughosh.ganu@linaro.org>2024-08-26 17:29:14 +0530
committerTom Rini <trini@konsulko.com>2024-09-03 14:08:49 -0600
commitc4eced2ec0d566e69281a2c20b0b43a141574318 (patch)
treecf73ee4131f64284c6f53e1ed855c08a07568af0
parent30e331e9cb7c14400dae385ed7ceab56eaa1e005 (diff)
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>
-rw-r--r--include/alist.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/alist.h b/include/alist.h
index 586a1efa5c8..68d268f01af 100644
--- a/include/alist.h
+++ b/include/alist.h
@@ -83,6 +83,17 @@ static inline bool alist_err(struct alist *lst)
}
/**
+ * 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
*
* @lst: alist to check