/* Remove given timer from given list of active timers.  */
static int timer_list_remove_isr(struct timer_list_t *self_p, struct timer_t *timer_p)
/* Remove given timer from given list of active timers.  */
static int timer_list_remove_isr(struct timer_list_t *self_p, struct timer_t *timer_p)
{
    struct timer_t *elem_p;
    struct timer_t *prev_p;
    elem_p = self_p->head_p;
    prev_p = NULL;
    while (elem_p != NULL) {
        if (elem_p == timer_p) {
            if (prev_p != NULL) {
                prev_p->next_p = elem_p->next_p;
            } else {
                self_p->head_p = elem_p->next_p;
            }
            if (elem_p->next_p != &self_p->tail) {
                elem_p->next_p->delta += elem_p->delta;
            }
            return (1);
        }
        prev_p = elem_p;
        elem_p = elem_p->next_p;
    }
    return (0);
}