Commit 9594949b authored by Mike Travis's avatar Mike Travis Committed by Ingo Molnar

irq: change references from NR_IRQS to nr_irqs

Impact: preparation, cleanup, add KERN_INFO printk

Modify references from NR_IRQS to nr_irqs as the later will become
variable-sized based on nr_cpu_ids when CONFIG_SPARSE_IRQS=y.
Signed-off-by: default avatarMike Travis <travis@sgi.com>
parent c7a3589e
...@@ -3183,7 +3183,7 @@ unsigned int create_irq_nr(unsigned int irq_want) ...@@ -3183,7 +3183,7 @@ unsigned int create_irq_nr(unsigned int irq_want)
irq = 0; irq = 0;
spin_lock_irqsave(&vector_lock, flags); spin_lock_irqsave(&vector_lock, flags);
for (new = irq_want; new < NR_IRQS; new++) { for (new = irq_want; new < nr_irqs; new++) {
if (platform_legacy_irq(new)) if (platform_legacy_irq(new))
continue; continue;
......
...@@ -132,6 +132,8 @@ int __init early_irq_init(void) ...@@ -132,6 +132,8 @@ int __init early_irq_init(void)
int legacy_count; int legacy_count;
int i; int i;
printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs);
desc = irq_desc_legacy; desc = irq_desc_legacy;
legacy_count = ARRAY_SIZE(irq_desc_legacy); legacy_count = ARRAY_SIZE(irq_desc_legacy);
...@@ -143,7 +145,7 @@ int __init early_irq_init(void) ...@@ -143,7 +145,7 @@ int __init early_irq_init(void)
irq_desc_ptrs[i] = desc + i; irq_desc_ptrs[i] = desc + i;
} }
for (i = legacy_count; i < NR_IRQS; i++) for (i = legacy_count; i < nr_irqs; i++)
irq_desc_ptrs[i] = NULL; irq_desc_ptrs[i] = NULL;
return arch_early_irq_init(); return arch_early_irq_init();
...@@ -151,7 +153,7 @@ int __init early_irq_init(void) ...@@ -151,7 +153,7 @@ int __init early_irq_init(void)
struct irq_desc *irq_to_desc(unsigned int irq) struct irq_desc *irq_to_desc(unsigned int irq)
{ {
return (irq < NR_IRQS) ? irq_desc_ptrs[irq] : NULL; return (irq < nr_irqs) ? irq_desc_ptrs[irq] : NULL;
} }
struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
...@@ -160,9 +162,9 @@ struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) ...@@ -160,9 +162,9 @@ struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
unsigned long flags; unsigned long flags;
int node; int node;
if (irq >= NR_IRQS) { if (irq >= nr_irqs) {
printk(KERN_WARNING "irq >= NR_IRQS in irq_to_desc_alloc: %d %d\n", printk(KERN_WARNING "irq >= nr_irqs in irq_to_desc_alloc: %d %d\n",
irq, NR_IRQS); irq, nr_irqs);
WARN_ON(1); WARN_ON(1);
return NULL; return NULL;
} }
...@@ -214,6 +216,8 @@ int __init early_irq_init(void) ...@@ -214,6 +216,8 @@ int __init early_irq_init(void)
int count; int count;
int i; int i;
printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS);
desc = irq_desc; desc = irq_desc;
count = ARRAY_SIZE(irq_desc); count = ARRAY_SIZE(irq_desc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment