It only worked because n was always 1. kmod_list_remove returns a
pointer to the next element, relative to the removed one. Therefore we
need to always get a pointer to the last.
kmod_list_prev() should return NULL if the current element is the
head, not if the previous element is the head. This was likely a copy
& paste error from kmod_list_next().
Lines should not go over 80 chars with a few exceptions:
- headers
- function definitions with only 1 argument
- long strings, otherwise we break grep
This should go later in a coding-style file
functions that do not modify their parameters get them as const pointers.
special cases:
* kmod_get_userdata/kmod_set_userdata: return as void* for user convenience.
* kmod_list_append/kmod_list_prepend: take const void* for user convenience.