/* return the highest priority found in mask (highest = smallest number). Return 8 if no irq  */
static int get_priority(struct kvm_kpic_state *s, int mask)
/* return the highest priority found in mask (highest = smallest number). Return 8 if no irq  */
static int get_priority(struct kvm_kpic_state *s, int mask)
{
	int priority;
	if (mask == 0)
		return 8;
	priority = 0;
	while ((mask & (1 << ((priority + s->priority_add) & 7))) == 0)
		priority++;
	return priority;
}