voron

experimental ARM OS
git clone git://git.2f30.org/voron.git
Log | Files | Refs | LICENSE

commit d1bdc6c0d2c7fafc7a076ba65a6e381f7bafb776
parent 5375d415a2b2b47fa9288fcf759ff17abdf30c39
Author: oblique <psyberbits@gmail.com>
Date:   Wed Oct 31 23:55:03 +0200

add list_move_tail()

Diffstat:
include/list.h | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/list.h b/include/list.h @@ -53,21 +53,28 @@ list_del(struct list_head *entry) static inline void list_add(struct list_head *entry, struct list_head *head) { - head->next->prev = entry; entry->next = head->next; entry->prev = head; + head->next->prev = entry; head->next = entry; } static inline void list_add_tail(struct list_head *entry, struct list_head *head) { - head->prev->next = entry; entry->next = head; entry->prev = head->prev; + head->prev->next = entry; head->prev = entry; } +static inline void +list_move_tail(struct list_head *entry, struct list_head *head) +{ + list_del(entry); + list_add_tail(entry, head); +} + static inline int list_empty(const struct list_head *head) {