diff options
author | Mike Travis <travis@sgi.com> | 2009-01-11 01:24:06 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-11 13:13:29 -0500 |
commit | 9594949b060efe86ecaa1a66839232a3b9800bc9 (patch) | |
tree | 5d0a450fd271c23c838e22f5e6998d24f6921e3c | |
parent | c7a3589e7a1f8fdbd2536fe1bfa60b37f5121c69 (diff) |
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: Mike Travis <travis@sgi.com>
-rw-r--r-- | arch/x86/kernel/io_apic.c | 2 | ||||
-rw-r--r-- | kernel/irq/handle.c | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 1337eab60ecc..ae80638012de 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -3183,7 +3183,7 @@ unsigned int create_irq_nr(unsigned int irq_want) | |||
3183 | 3183 | ||
3184 | irq = 0; | 3184 | irq = 0; |
3185 | spin_lock_irqsave(&vector_lock, flags); | 3185 | spin_lock_irqsave(&vector_lock, flags); |
3186 | for (new = irq_want; new < NR_IRQS; new++) { | 3186 | for (new = irq_want; new < nr_irqs; new++) { |
3187 | if (platform_legacy_irq(new)) | 3187 | if (platform_legacy_irq(new)) |
3188 | continue; | 3188 | continue; |
3189 | 3189 | ||
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index f01c0a30cb42..790c5fa7ea39 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -132,6 +132,8 @@ int __init early_irq_init(void) | |||
132 | int legacy_count; | 132 | int legacy_count; |
133 | int i; | 133 | int i; |
134 | 134 | ||
135 | printk(KERN_INFO "NR_IRQS:%d nr_irqs:%d\n", NR_IRQS, nr_irqs); | ||
136 | |||
135 | desc = irq_desc_legacy; | 137 | desc = irq_desc_legacy; |
136 | legacy_count = ARRAY_SIZE(irq_desc_legacy); | 138 | legacy_count = ARRAY_SIZE(irq_desc_legacy); |
137 | 139 | ||
@@ -143,7 +145,7 @@ int __init early_irq_init(void) | |||
143 | irq_desc_ptrs[i] = desc + i; | 145 | irq_desc_ptrs[i] = desc + i; |
144 | } | 146 | } |
145 | 147 | ||
146 | for (i = legacy_count; i < NR_IRQS; i++) | 148 | for (i = legacy_count; i < nr_irqs; i++) |
147 | irq_desc_ptrs[i] = NULL; | 149 | irq_desc_ptrs[i] = NULL; |
148 | 150 | ||
149 | return arch_early_irq_init(); | 151 | return arch_early_irq_init(); |
@@ -151,7 +153,7 @@ int __init early_irq_init(void) | |||
151 | 153 | ||
152 | struct irq_desc *irq_to_desc(unsigned int irq) | 154 | struct irq_desc *irq_to_desc(unsigned int irq) |
153 | { | 155 | { |
154 | return (irq < NR_IRQS) ? irq_desc_ptrs[irq] : NULL; | 156 | return (irq < nr_irqs) ? irq_desc_ptrs[irq] : NULL; |
155 | } | 157 | } |
156 | 158 | ||
157 | struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | 159 | 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 | unsigned long flags; | 162 | unsigned long flags; |
161 | int node; | 163 | int node; |
162 | 164 | ||
163 | if (irq >= NR_IRQS) { | 165 | if (irq >= nr_irqs) { |
164 | printk(KERN_WARNING "irq >= NR_IRQS in irq_to_desc_alloc: %d %d\n", | 166 | printk(KERN_WARNING "irq >= nr_irqs in irq_to_desc_alloc: %d %d\n", |
165 | irq, NR_IRQS); | 167 | irq, nr_irqs); |
166 | WARN_ON(1); | 168 | WARN_ON(1); |
167 | return NULL; | 169 | return NULL; |
168 | } | 170 | } |
@@ -214,6 +216,8 @@ int __init early_irq_init(void) | |||
214 | int count; | 216 | int count; |
215 | int i; | 217 | int i; |
216 | 218 | ||
219 | printk(KERN_INFO "NR_IRQS:%d\n", NR_IRQS); | ||
220 | |||
217 | desc = irq_desc; | 221 | desc = irq_desc; |
218 | count = ARRAY_SIZE(irq_desc); | 222 | count = ARRAY_SIZE(irq_desc); |
219 | 223 | ||