From: Simon Glass <sjg@chromium.org>
Date: Sat, 19 Oct 2024 15:21:43 +0000 (-0600)
Subject: alist: Expand the comment for alist_get()
X-Git-Tag: v2025.01-rc5-pxa1908~152^2~25
X-Git-Url: http://git.dujemihanovic.xyz/img/static//%22brlog.php?a=commitdiff_plain;h=eb6e87a7ab9f93596983b57eef08509beeedf3fb;p=u-boot.git

alist: Expand the comment for alist_get()

Add a better description for this macro.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/include/alist.h b/include/alist.h
index a727f1c7df..2c78ede201 100644
--- a/include/alist.h
+++ b/include/alist.h
@@ -116,7 +116,12 @@ static inline const void *alist_getd(struct alist *lst, uint index)
 	return lst->data + index * lst->obj_size;
 }
 
-/** get an entry as a constant */
+/**
+ * alist_get() - get an entry as a constant
+ *
+ * Use as (to obtain element 2 of the list):
+ *	const struct my_struct *ptr = alist_get(lst, 2, struct my_struct)
+ */
 #define alist_get(_lst, _index, _struct)	\
 	((const _struct *)alist_get_ptr(_lst, _index))