Re: [PATCH v2] x86, ioapic: Skip looking for ioapic overrides whenioapics are not present
From: Ingo Molnar
Date: Fri Apr 01 2011 - 03:50:27 EST
* Len Brown <lenb@xxxxxxxxxx> wrote:
>
> > > --- a/arch/x86/kernel/apic/io_apic.c
> > > +++ b/arch/x86/kernel/apic/io_apic.c
> > > @@ -3789,6 +3789,10 @@ int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity)
> > > {
> > > int ioapic, pin, idx;
> > >
> > > +#ifdef CONFIG_ACPI
> > > + if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC)
> > > + return -1;
> > > +#endif
> >
> > That #ifdef is very ugly. Please introduce a suitable helper function in
> > arch/x86/include/asm/acpi.h - acpi_irq_ioapic_model() or so, which could be
> > used like this:
> >
> > if (!acpi_irq_ioapic_model())
> > return -1;
> >
> > And would be defined in the !CONFIG_ACPI case as well.
>
> It would be better to compile _none_ of acpi_get_override_irq() for !ACPI.
Yeah, agreed - so just move the function into acpi.c and provide an inline stub
in acpi.h for the !ACPI case.
Note: find_irq_entry() would have to be exported from io_apic.c in this case,
renamed to ioapic_find_irq_entry() or so - and a stub provided for the !IO_APIC
case.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/