Having this in the middle of code is beyond ugly. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/desc.h | 5 +++++ arch/x86/kernel/irqinit.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) --- a/arch/x86/include/asm/desc.h +++ b/arch/x86/include/asm/desc.h @@ -482,7 +482,12 @@ static inline void _set_gate(int gate, u 0, 0, __KERNEL_CS); \ } while (0) +#ifdef CONFIG_X86_LOCAL_APIC extern int first_system_vector; +#else +#define first_system_vector NR_VECTORS +#endif + /* used_vectors is BITMAP for irq is not managed by percpu vector_irq */ extern unsigned long used_vectors[]; --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c @@ -169,9 +169,6 @@ void __init native_init_IRQ(void) * 'special' SMP interrupts) */ i = FIRST_EXTERNAL_VECTOR; -#ifndef CONFIG_X86_LOCAL_APIC -#define first_system_vector NR_VECTORS -#endif for_each_clear_bit_from(i, used_vectors, first_system_vector) { /* IA32_SYSCALL_VECTOR could be used in trap_init already. */ set_intr_gate(i, irq_entries_start +