kernel/src/ds/vp_singly_linked_list.c
void * vpsll_remove(VPSinglyLinkedList * lst, void * data, CompareFunc compf) {
    struct VPSinglyLinkedListLink * prev = NULL;
    VPSLL_FOREACH(lst, i) {
        if (compf(i->data, data)) {
            void * value = i->data;
            if (prev == NULL) {
                lst->head = i->next;
            } else {
                prev->next = i->next;
                kfree(i);
            }
            lst->length--;
            return value;
        }
        prev = i;
    }

    return NULL;
}
// Remove the first item for which compf returns true.
Remove the first item for which compf returns true.
Remove the first item for which compf returns true .
void * vpsll_remove(VPSinglyLinkedList * lst, void * data, CompareFunc compf) {
    struct VPSinglyLinkedListLink * prev = NULL;
    VPSLL_FOREACH(lst, i) {
        if (compf(i->data, data)) {
            void * value = i->data;
            if (prev == NULL) {
                lst->head = i->next;
            } else {
                prev->next = i->next;
                kfree(i);
            }
            lst->length--;
            return value;
        }
        prev = i;
    }
    return NULL;
}
void * vpsll_remove ( VPSinglyLinkedList * lst , void * data , CompareFunc compf ) { struct VPSinglyLinkedListLink * prev = NULL ; VPSLL_FOREACH ( lst , i ) { if ( compf ( i -> data , data ) ) { void * value = i -> data ; if ( prev == NULL ) { lst -> head = i -> next ; } else { prev -> next = i -> next ; kfree ( i ) ; } lst -> length -- ; return value ; } prev = i ; } return NULL ; }
Remove the first item for which compf returns true.
Remove the first item for which compf returns true .