X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/a5338b60e111972364a8bc6f07011c6defd213d2..e6dbd781772925dfc07b2facfa0a1350e756ad8f:/lunaix-os/includes/lunaix/ds/llist.h diff --git a/lunaix-os/includes/lunaix/ds/llist.h b/lunaix-os/includes/lunaix/ds/llist.h index 9af9dd1..22e0f93 100644 --- a/lunaix-os/includes/lunaix/ds/llist.h +++ b/lunaix-os/includes/lunaix/ds/llist.h @@ -41,13 +41,13 @@ llist_init_head(struct llist_header* head) static inline void llist_append(struct llist_header* head, struct llist_header* elem) { - __llist_add(elem, head, head->next); + __llist_add(elem, head->prev, head); } static inline void llist_prepend(struct llist_header* head, struct llist_header* elem) { - __llist_add(elem, head->prev, head); + __llist_add(elem, head, head->next); } static inline void @@ -93,8 +93,10 @@ struct hlist_node }; static inline void -hlist_del(struct hlist_node* node) +hlist_delete(struct hlist_node* node) { + if (!node->pprev) + return; *node->pprev = node->next; node->next = 0; node->pprev = 0;