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. bluhm