laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/27491 )
Change subject: Cosmetic: linuxlist.h: fix misleading comment ......................................................................
Cosmetic: linuxlist.h: fix misleading comment
Whenever iterating over a list and removing entries, llist_for_each_entry_safe must be used instead of llist_for_each_entry.
The comment with "non-consecutive(!)" entries sounds like this is not needed as long as one is iterating over the list consecutively. I guess that might have worked with prefetch logic, however the prefetch function is just a stub in linuxlist.h. (Also prefetch has been removed from list.h in linux.git e66eed651fd18a961f11cda62f3b5286c8cc4f9f.)
Change-Id: I217e6871afe121edba26e4c6fd1a461e397c9e72 --- M include/osmocom/core/linuxlist.h 1 file changed, 1 insertion(+), 2 deletions(-)
Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index 725c60c..2fc3fa7 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -328,8 +328,7 @@ pos = llist_entry(pos->member.next, typeof(*pos), member), \ prefetch(pos->member.next))
-/*! Iterate over llist of given type, safe against removal of - * non-consecutive(!) llist entries. +/*! Iterate over llist of given type, safe against removal of llist entry. * \param pos the 'type *' to use as a loop counter. * \param n another 'type *' to use as temporary storage. * \param head the head of the list over which to iterate.