Skip to content
Commit c22e60c3 authored by Jakob Koschel's avatar Jakob Koschel Committed by Jonathan Cameron
Browse files

iio: buffer: remove usage of list iterator variable for list_for_each_entry_continue_reverse()

In preparation to limit the scope of the list iterator variable to the
list traversal loop, use a dedicated pointer to iterate through the
list [1].

Since that variable should not be used past the loop iteration, a
separate variable is used to 'remember the current location within the
loop'.

To either continue iterating from that position or start a new
iteration (if the previous iteration was complete) list_prepare_entry()
is used.

Link: https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/

 [1]
Signed-off-by: default avatarJakob Koschel <jakobkoschel@gmail.com>
Reviewed-by: default avatarNuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220331230632.957634-1-jakobkoschel@gmail.com


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent a8e1f0ba
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment