/* Find the IRQ entry number of a certain pin.  */
static int find_irq_entry(int apic, int pin, int type)
/* Find the IRQ entry number of a certain pin.  */
static int find_irq_entry(int apic, int pin, int type)
{
	int i;
	for (i = 0; i < mp_irq_entries; i++)
		if (mp_irqs[i].irqtype == type &&
		    (mp_irqs[i].dstapic == mp_ioapics[apic].apicid ||
		     mp_irqs[i].dstapic == MP_APIC_ALL) &&
		    mp_irqs[i].dstirq == pin)
			return i;
	return -1;
}