diff options
author | Richard Braun <rbraun@sceen.net> | 2018-02-24 07:25:55 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-02-24 07:25:55 +0100 |
commit | c31ddfaf11320dea4828c753f48a29041643f552 (patch) | |
tree | 88b5c776170c406f90e686c347c7b9fef09d9c38 /kern/list.h | |
parent | 6a69c45189d3c576cc18dfac6e426cd606831657 (diff) |
kern/{cbuf,fmt,hash,hlist,list,plist,rdxtree,shell,slist}: update from upstream
Note that this commit changes the order of some list operations without
triggering warnings.
Diffstat (limited to 'kern/list.h')
-rw-r--r-- | kern/list.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kern/list.h b/kern/list.h index 7b7e0f6e..6c1f7a4c 100644 --- a/kern/list.h +++ b/kern/list.h @@ -136,7 +136,7 @@ list_empty(const struct list *list) static inline bool list_singular(const struct list *list) { - return (list != list->next) && (list->next == list->prev); + return !list_empty(list) && (list->next == list->prev); } /* @@ -248,7 +248,7 @@ list_insert_tail(struct list *list, struct list *node) * Insert a node before another node. */ static inline void -list_insert_before(struct list *next, struct list *node) +list_insert_before(struct list *node, struct list *next) { list_add(next->prev, next, node); } @@ -257,7 +257,7 @@ list_insert_before(struct list *next, struct list *node) * Insert a node after another node. */ static inline void -list_insert_after(struct list *prev, struct list *node) +list_insert_after(struct list *node, struct list *prev) { list_add(prev, prev->next, node); } @@ -435,7 +435,7 @@ list_rcu_insert_tail(struct list *list, struct list *node) * Insert a node before another node. */ static inline void -list_rcu_insert_before(struct list *next, struct list *node) +list_rcu_insert_before(struct list *node, struct list *next) { list_rcu_add(next->prev, next, node); } @@ -444,7 +444,7 @@ list_rcu_insert_before(struct list *next, struct list *node) * Insert a node after another node. */ static inline void -list_rcu_insert_after(struct list *prev, struct list *node) +list_rcu_insert_after(struct list *node, struct list *prev) { list_rcu_add(prev, prev->next, node); } |