@@ -132,6 +132,7 @@ DECLARE_BITMAP(mp_bus_not_pci, MAX_MP_BUSSES);
132132#define MAX_PLUS_SHARED_IRQS NR_IRQS
133133#define PIN_MAP_SIZE (MAX_PLUS_SHARED_IRQS + NR_IRQS)
134134
135+ int pin_map_size = PIN_MAP_SIZE ;
135136/*
136137 * This is performance-critical, we want to do it O(1)
137138 *
@@ -224,7 +225,7 @@ static inline void io_apic_sync(unsigned int apic)
224225 int pin; \
225226 struct irq_pin_list *entry = irq_2_pin + irq; \
226227 \
227- BUG_ON(irq >= NR_IRQS ); \
228+ BUG_ON(irq >= nr_irqs ); \
228229 for (;;) { \
229230 unsigned int reg; \
230231 pin = entry->pin; \
@@ -301,7 +302,7 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, u8 vector)
301302 int apic , pin ;
302303 struct irq_pin_list * entry = irq_2_pin + irq ;
303304
304- BUG_ON (irq >= NR_IRQS );
305+ BUG_ON (irq >= nr_irqs );
305306 for (;;) {
306307 unsigned int reg ;
307308 apic = entry -> apic ;
@@ -358,19 +359,19 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask)
358359 * shared ISA-space IRQs, so we have to support them. We are super
359360 * fast in the common case, and fast for shared ISA-space IRQs.
360361 */
362+ int first_free_entry = NR_IRQS ;
361363static void add_pin_to_irq (unsigned int irq , int apic , int pin )
362364{
363- static int first_free_entry = NR_IRQS ;
364365 struct irq_pin_list * entry = irq_2_pin + irq ;
365366
366- BUG_ON (irq >= NR_IRQS );
367+ BUG_ON (irq >= nr_irqs );
367368 while (entry -> next )
368369 entry = irq_2_pin + entry -> next ;
369370
370371 if (entry -> pin != -1 ) {
371372 entry -> next = first_free_entry ;
372373 entry = irq_2_pin + entry -> next ;
373- if (++ first_free_entry >= PIN_MAP_SIZE )
374+ if (++ first_free_entry >= pin_map_size )
374375 panic ("io_apic.c: ran out of irq_2_pin entries!" );
375376 }
376377 entry -> apic = apic ;
@@ -634,7 +635,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin)
634635 best_guess = irq ;
635636 }
636637 }
637- BUG_ON (best_guess >= NR_IRQS );
638+ BUG_ON (best_guess >= nr_irqs );
638639 return best_guess ;
639640}
640641
@@ -766,7 +767,7 @@ static int pin_2_irq(int idx, int apic, int pin)
766767 irq += nr_ioapic_registers [i ++ ];
767768 irq += pin ;
768769 }
769- BUG_ON (irq >= NR_IRQS );
770+ BUG_ON (irq >= nr_irqs );
770771 return irq ;
771772}
772773
@@ -801,7 +802,7 @@ static int __assign_irq_vector(int irq, cpumask_t mask)
801802 int cpu ;
802803 struct irq_cfg * cfg ;
803804
804- BUG_ON ((unsigned )irq >= NR_IRQS );
805+ BUG_ON ((unsigned )irq >= nr_irqs );
805806 cfg = & irq_cfg [irq ];
806807
807808 /* Only try and allocate irqs on cpus that are present */
@@ -875,7 +876,7 @@ static void __clear_irq_vector(int irq)
875876 cpumask_t mask ;
876877 int cpu , vector ;
877878
878- BUG_ON ((unsigned )irq >= NR_IRQS );
879+ BUG_ON ((unsigned )irq >= nr_irqs );
879880 cfg = & irq_cfg [irq ];
880881 BUG_ON (!cfg -> vector );
881882
@@ -895,7 +896,7 @@ void __setup_vector_irq(int cpu)
895896 int irq , vector ;
896897
897898 /* Mark the inuse vectors */
898- for (irq = 0 ; irq < NR_IRQS ; ++ irq ) {
899+ for (irq = 0 ; irq < nr_irqs ; ++ irq ) {
899900 if (!cpu_isset (cpu , irq_cfg [irq ].domain ))
900901 continue ;
901902 vector = irq_cfg [irq ].vector ;
@@ -1193,7 +1194,7 @@ __apicdebuginit(void) print_IO_APIC(void)
11931194 }
11941195 }
11951196 printk (KERN_DEBUG "IRQ to pin mappings:\n" );
1196- for (i = 0 ; i < NR_IRQS ; i ++ ) {
1197+ for (i = 0 ; i < nr_irqs ; i ++ ) {
11971198 struct irq_pin_list * entry = irq_2_pin + i ;
11981199 if (entry -> pin < 0 )
11991200 continue ;
@@ -1366,7 +1367,7 @@ void __init enable_IO_APIC(void)
13661367 int i , apic ;
13671368 unsigned long flags ;
13681369
1369- for (i = 0 ; i < PIN_MAP_SIZE ; i ++ ) {
1370+ for (i = 0 ; i < pin_map_size ; i ++ ) {
13701371 irq_2_pin [i ].pin = -1 ;
13711372 irq_2_pin [i ].next = 0 ;
13721373 }
@@ -1658,7 +1659,7 @@ static void ir_irq_migration(struct work_struct *work)
16581659{
16591660 int irq ;
16601661
1661- for (irq = 0 ; irq < NR_IRQS ; irq ++ ) {
1662+ for (irq = 0 ; irq < nr_irqs ; irq ++ ) {
16621663 struct irq_desc * desc = irq_desc + irq ;
16631664 if (desc -> status & IRQ_MOVE_PENDING ) {
16641665 unsigned long flags ;
@@ -1707,7 +1708,7 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
17071708 struct irq_desc * desc ;
17081709 struct irq_cfg * cfg ;
17091710 irq = __get_cpu_var (vector_irq )[vector ];
1710- if (irq >= NR_IRQS )
1711+ if (irq >= nr_irqs )
17111712 continue ;
17121713
17131714 desc = irq_desc + irq ;
@@ -1865,7 +1866,7 @@ static inline void init_IO_APIC_traps(void)
18651866 * Also, we've got to be careful not to trash gate
18661867 * 0x80, because int 0x80 is hm, kind of importantish. ;)
18671868 */
1868- for (irq = 0 ; irq < NR_IRQS ; irq ++ ) {
1869+ for (irq = 0 ; irq < nr_irqs ; irq ++ ) {
18691870 if (IO_APIC_IRQ (irq ) && !irq_cfg [irq ].vector ) {
18701871 /*
18711872 * Hmm.. We don't have an entry for this,
@@ -2279,7 +2280,7 @@ int create_irq(void)
22792280
22802281 irq = - ENOSPC ;
22812282 spin_lock_irqsave (& vector_lock , flags );
2282- for (new = (NR_IRQS - 1 ); new >= 0 ; new -- ) {
2283+ for (new = (nr_irqs - 1 ); new >= 0 ; new -- ) {
22832284 if (platform_legacy_irq (new ))
22842285 continue ;
22852286 if (irq_cfg [new ].vector != 0 )
0 commit comments