diff --git a/include/misc/slist.h b/include/misc/slist.h index 4afb8d729e5..11e451e7207 100644 --- a/include/misc/slist.h +++ b/include/misc/slist.h @@ -414,8 +414,10 @@ static inline void sys_slist_remove(sys_slist_t *list, * * @param list A pointer on the list to affect * @param node A pointer on the node to remove from the list + * + * @return true if node was removed */ -static inline void sys_slist_find_and_remove(sys_slist_t *list, +static inline bool sys_slist_find_and_remove(sys_slist_t *list, sys_snode_t *node) { sys_snode_t *prev = NULL; @@ -424,11 +426,13 @@ static inline void sys_slist_find_and_remove(sys_slist_t *list, SYS_SLIST_FOR_EACH_NODE(list, test) { if (test == node) { sys_slist_remove(list, prev, node); - break; + return true; } prev = test; } + + return false; }