lkml.org 
[lkml]   [2023]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH 1/2] add list_for_each_entry_del()
On Sat, Oct 21, 2023 at 12:00 PM David Laight <David.Laight@aculab.com> wrote:

> Adding a list_del_first() function that returns the deleted
> item or NULL to optimise it might make more sense.

Something like this?

- list_for_each_entry_del(entry, head, member))
+ while (list_del_first(entry, head, member))

This allows the compact loop condition, and I always hated having to
pass the type to list_*entry()... Disadvantage being that the
assignment is now implicit (just as with all the list iterators).

Thanks,
Miklos

\
 
 \ /
  Last update: 2023-10-26 11:54    [W:0.090 / U:3.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site