Skip to content

Commit 6a915a0

Browse files
committed
Docs: Clarify list_add documentation
Originally, the function list_add is said to insert a node at the beginning of a given list. However, it could also be used to insert a node after any existing node in the list. Therefore, this commit modifies its documentation to reflect the actual list manipulation performed by the function. Change-Id: I661d7a0ebb876712c8ff75deef84370a51e62f1c
1 parent e3d96b3 commit 6a915a0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

list.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ static inline void INIT_LIST_HEAD(struct list_head *head)
9090
}
9191

9292
/**
93-
* list_add - Insert a node at the beginning of a circular list
93+
* list_add - Insert a node after a given node in a circular list
9494
* @node: Pointer to the list_head structure to add.
95-
* @head: Pointer to the list_head structure representing the list head.
95+
* @head: Pointer to the list_head structure after which to add the new node.
9696
*
9797
* Adds the specified @node immediately after @head in a circular doubly-linked
98-
* list, effectively placing it at the beginning. The existing first node, if
99-
* any, shifts to follow @node, and the list's circular structure is maintained.
98+
* list. The node that previously followed @head will now follow @node, and the
99+
* list's circular structure is maintained.
100100
*/
101101
static inline void list_add(struct list_head *node, struct list_head *head)
102102
{

0 commit comments

Comments
 (0)