/* The class is removed from row at priorities marked in mask. It does nothing if mask == 0.  */
static void htb_remove_class_from_row(struct htb_sched *q, struct htb_class *cl, int mask)
/* The class is removed from row at priorities marked in mask. It does nothing if mask == 0.  */
static void htb_remove_class_from_row(struct htb_sched *q, struct htb_class *cl, int mask)
{
	int m = 0;
	while (mask) {
		int prio = ffz(~mask);
		mask &= ~(1 << prio);
		if (q->ptr[cl->level][prio] == cl->node + prio)
			htb_next_rb_node(q->ptr[cl->level] + prio);
		htb_safe_rb_erase(cl->node + prio, q->row[cl->level] + prio);
		if (!q->row[cl->level][prio].rb_node)
			m |= 1 << prio;
	}
	q->row_mask[cl->level] &= ~m;
}