This patch adds new list structure based of 'next' and 'pprev' pointers. This list type is widely used in the kernel but it is not defined explicitly. Patch provides generic interface for such lists. It eliminates special case during last element processing. This patch works for me.
Further testing is needed.
Testing is especially required on Sparc. If you have suggestions feel free to mail me. It allows removing entries without checking if the're alredy on a list.