/* The common case is 1:1 IRQ<->pin mappings. Sometimes there are shared ISA-space IRQs, so we have to support them. We are super fast in the common case, and fast for shared ISA-space IRQs.  */
static int add_pin_to_irq_node_nopanic(struct irq_cfg *cfg, int node, int apic, int pin)
/* The common case is 1:1 IRQ<->pin mappings. Sometimes there are shared ISA-space IRQs, so we have to support them. We are super fast in the common case, and fast for shared ISA-space IRQs.  */
static int add_pin_to_irq_node_nopanic(struct irq_cfg *cfg, int node, int apic, int pin)
{
	struct irq_pin_list **last, *entry;
	last = &cfg->irq_2_pin;
	for_each_irq_pin(entry, cfg->irq_2_pin) {
		if (entry->apic == apic && entry->pin == pin)
			return 0;
		last = &entry->next;
	}
	entry = get_one_free_irq_2_pin(node);
	if (!entry) {
		printk(KERN_ERR "can not alloc irq_pin_list (%d,%d,%d)\n",
				node, apic, pin);
		return -ENOMEM;
	}
	entry->apic = apic;
	entry->pin = pin;
	*last = entry;
	return 0;
}