mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
util/list.h: Add docstrings for list_add and list_addtail
Which have easily confused parameters: the first argument is the item to be added, the second is the list to add to; but this could easily be the other way around. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14983>
This commit is contained in:
parent
b0faf422b7
commit
4b10a4aaaa
1 changed files with 12 additions and 0 deletions
|
|
@ -61,6 +61,12 @@ static inline void list_inithead(struct list_head *item)
|
|||
item->next = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepend an item to a list
|
||||
*
|
||||
* @param item The element to add to the list
|
||||
* @param list The list to prepend to
|
||||
*/
|
||||
static inline void list_add(struct list_head *item, struct list_head *list)
|
||||
{
|
||||
item->prev = list;
|
||||
|
|
@ -69,6 +75,12 @@ static inline void list_add(struct list_head *item, struct list_head *list)
|
|||
list->next = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Append an item to a list
|
||||
*
|
||||
* @param item The element to add to the list
|
||||
* @param list The list to append to
|
||||
*/
|
||||
static inline void list_addtail(struct list_head *item, struct list_head *list)
|
||||
{
|
||||
item->next = list;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue