Skip to content

Commit

Permalink
[mpp_list]: Add list_mode and list_move_tail
Browse files Browse the repository at this point in the history
Change-Id: I7be6f69a073eeedef1b0d9ff7e9a47b48df8a8fa
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
  • Loading branch information
HermanChen committed Sep 17, 2021
1 parent c5cd650 commit 6cc2ef5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions osal/inc/mpp_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ static __inline void list_del_init(struct list_head *entry)
INIT_LIST_HEAD(entry);
}

static __inline void list_move(struct list_head *list, struct list_head *head)
{
__list_del(list->prev, list->next);
list_add(list, head);
}

static __inline void list_move_tail(struct list_head *list, struct list_head *head)
{
__list_del(list->prev, list->next);
list_add_tail(list, head);
}

static __inline int list_is_last(const struct list_head *list, const struct list_head *head)
{
return list->next == head;
Expand Down

0 comments on commit 6cc2ef5

Please sign in to comment.