Skip to content

Commit 8044136

Browse files
committed
wait: add list_item_insert function
Add insert function for list. Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
1 parent 834d3cb commit 8044136

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/include/sof/list.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ static inline void list_item_append(struct list_item *item,
7272
list->prev = item;
7373
}
7474

75+
/* insert new item to the position of the list */
76+
static inline void list_item_insert(struct list_item *item,
77+
struct list_item *pos)
78+
{
79+
struct list_item *tmp = pos->next;
80+
81+
item->next = tmp;
82+
item->prev = pos;
83+
pos->next = item;
84+
tmp->prev = item;
85+
}
86+
7587
/* delete item from the list leaves deleted list item
7688
*in undefined state list_is_empty won't return true
7789
*/

0 commit comments

Comments
 (0)