diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2008-12-25 22:24:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-26 03:48:17 -0500 |
commit | f9af0e70911e9d6cc9a68f784dca86415486084d (patch) | |
tree | 58a83c34cc8a511b5e05d48425251621e9b471a1 /kernel/irq | |
parent | 51bc39f4ba35bae153b32145077fb1109bcae14c (diff) |
irq: for_each_irq_desc() move to irqnr.h
Impact: cleanup
before CONFIG_SPARSE_IRQ age, for_each_irq_desc() sat in irqnr.h and
could be called from generic code.
CONFIG_SPARSE_IRQ breaks this assumption, but SPARSE_IRQ version
for_each_irq_desc() also can move into irqnr.h easily.
Also, this patch unifies CONFIG_SPARSE_IRQ and !CONFIG_SPARSE_IRQ
for_each_irq_desc().
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/handle.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 6492400cb50d..4db7d2df86b6 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -203,7 +203,7 @@ out_unlock: | |||
203 | return desc; | 203 | return desc; |
204 | } | 204 | } |
205 | 205 | ||
206 | #else | 206 | #else /* !CONFIG_SPARSE_IRQ */ |
207 | 207 | ||
208 | struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { | 208 | struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { |
209 | [0 ... NR_IRQS-1] = { | 209 | [0 ... NR_IRQS-1] = { |
@@ -218,7 +218,16 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { | |||
218 | } | 218 | } |
219 | }; | 219 | }; |
220 | 220 | ||
221 | #endif | 221 | struct irq_desc *irq_to_desc(unsigned int irq) |
222 | { | ||
223 | return (irq < NR_IRQS) ? irq_desc + irq : NULL; | ||
224 | } | ||
225 | |||
226 | struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu) | ||
227 | { | ||
228 | return irq_to_desc(irq); | ||
229 | } | ||
230 | #endif /* !CONFIG_SPARSE_IRQ */ | ||
222 | 231 | ||
223 | /* | 232 | /* |
224 | * What should we do if we get a hw irq event on an illegal vector? | 233 | * What should we do if we get a hw irq event on an illegal vector? |