On Mon, Oct 09, 2017 at 11:21:24PM +0200, Alexander Bluhm wrote: > On Tue, Oct 10, 2017 at 12:07:31AM +0300, Paul Irofti wrote: > > I needed this in a program and searching the kernel I see that this is > > also hacked in a few places (e.g. mpii(4)). > > Why don't you use a double linked list? I consider that removing > with a loop is a hack instead of using as suitable data structure. > The problem is that if such macros exist, people start using them > without thinking whether they have chosen the correct type.
It depends. If this hack is a one-time thing, it might be worth doing it considering the global advantages of single-linked versus dobule-linked data structures. If the function call is abused, then I agree that switching to a better data structure would be the best move. If you guys want it fine, if not I'll keep it locally. No worries :)