summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2024-10-19 09:21:43 -0600
committerSimon Glass <[email protected]>2024-11-02 11:13:59 -0600
commit6668d860f78035969db301f2c43266094d455191 (patch)
tree5c31fd30c294903ed09ba3cd7a9c6b41e17e1180 /include
parent13bd29849953c7d5294b64ba22495a928dd70d80 (diff)
alist: Expand the comment for alist_get()
Add a better description for this macro. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/alist.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/alist.h b/include/alist.h
index a727f1c7dfa..2c78ede201e 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))