[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOssrKd2tO9a18qEUPnxnoWzD0WSvT2G7_kcJr=uunCd1xKXYA@mail.gmail.com>
Date: Thu, 26 Oct 2023 11:52:34 +0200
From: Miklos Szeredi <mszeredi@...hat.com>
To: David Laight <David.Laight@...lab.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Takashi Iwai <tiwai@...e.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>,
James Bottomley <James.Bottomley@...senpartnership.com>
Subject: Re: [RFC PATCH 1/2] add list_for_each_entry_del()
On Sat, Oct 21, 2023 at 12:00 PM David Laight <David.Laight@...lab.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
Powered by blists - more mailing lists