From 5e24eea15c44e5663a47c36632c15eafd3afad39 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Fri, 11 Mar 2022 15:34:32 +0100 Subject: [PATCH] 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 --- include/osmocom/core/linuxlist.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/osmocom/core/linuxlist.h b/include/osmocom/core/linuxlist.h index 725c60ca0..2fc3fa75d 100644 --- a/include/osmocom/core/linuxlist.h +++ b/include/osmocom/core/linuxlist.h @@ -328,8 +328,7 @@ static inline void llist_splice_init(struct llist_head *llist, 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.