diff options
author | Yinghai Lu <yhlu.kernel@gmail.com> | 2008-08-19 23:50:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 10:52:29 -0400 |
commit | 08678b0841267c1d00d771fe01548d86043d065e (patch) | |
tree | 7debb21f9e9a768ced43077f7376797a0c46f8c0 /kernel/irq/autoprobe.c | |
parent | bfea1238beac9d306eeac081c67de5ca6aec4c7a (diff) |
generic: sparse irqs: use irq_desc() together with dyn_array, instead of irq_desc[]
add CONFIG_HAVE_SPARSE_IRQ to for use condensed array.
Get rid of irq_desc[] array assumptions.
Preallocate 32 irq_desc, and irq_desc() will try to get more.
( No change in functionality is expected anywhere, except the odd build
failure where we missed a code site or where a crossing commit itroduces
new irq_desc[] usage. )
v2: according to Eric, change get_irq_desc() to irq_desc()
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/autoprobe.c')
-rw-r--r-- | kernel/irq/autoprobe.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c index c689e9851a80..c45ab718cf07 100644 --- a/kernel/irq/autoprobe.c +++ b/kernel/irq/autoprobe.c | |||
@@ -39,7 +39,7 @@ unsigned long probe_irq_on(void) | |||
39 | * flush such a longstanding irq before considering it as spurious. | 39 | * flush such a longstanding irq before considering it as spurious. |
40 | */ | 40 | */ |
41 | for (i = nr_irqs-1; i > 0; i--) { | 41 | for (i = nr_irqs-1; i > 0; i--) { |
42 | desc = irq_desc + i; | 42 | desc = irq_to_desc(i); |
43 | 43 | ||
44 | spin_lock_irq(&desc->lock); | 44 | spin_lock_irq(&desc->lock); |
45 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { | 45 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { |
@@ -69,7 +69,7 @@ unsigned long probe_irq_on(void) | |||
69 | * happened in the previous stage, it may have masked itself) | 69 | * happened in the previous stage, it may have masked itself) |
70 | */ | 70 | */ |
71 | for (i = nr_irqs-1; i > 0; i--) { | 71 | for (i = nr_irqs-1; i > 0; i--) { |
72 | desc = irq_desc + i; | 72 | desc = irq_to_desc(i); |
73 | 73 | ||
74 | spin_lock_irq(&desc->lock); | 74 | spin_lock_irq(&desc->lock); |
75 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { | 75 | if (!desc->action && !(desc->status & IRQ_NOPROBE)) { |
@@ -92,7 +92,7 @@ unsigned long probe_irq_on(void) | |||
92 | for (i = 0; i < nr_irqs; i++) { | 92 | for (i = 0; i < nr_irqs; i++) { |
93 | unsigned int status; | 93 | unsigned int status; |
94 | 94 | ||
95 | desc = irq_desc + i; | 95 | desc = irq_to_desc(i); |
96 | spin_lock_irq(&desc->lock); | 96 | spin_lock_irq(&desc->lock); |
97 | status = desc->status; | 97 | status = desc->status; |
98 | 98 | ||
@@ -131,7 +131,7 @@ unsigned int probe_irq_mask(unsigned long val) | |||
131 | 131 | ||
132 | mask = 0; | 132 | mask = 0; |
133 | for (i = 0; i < nr_irqs; i++) { | 133 | for (i = 0; i < nr_irqs; i++) { |
134 | struct irq_desc *desc = irq_desc + i; | 134 | struct irq_desc *desc = irq_to_desc(i); |
135 | unsigned int status; | 135 | unsigned int status; |
136 | 136 | ||
137 | spin_lock_irq(&desc->lock); | 137 | spin_lock_irq(&desc->lock); |
@@ -174,7 +174,7 @@ int probe_irq_off(unsigned long val) | |||
174 | int i, irq_found = 0, nr_irqs = 0; | 174 | int i, irq_found = 0, nr_irqs = 0; |
175 | 175 | ||
176 | for (i = 0; i < nr_irqs; i++) { | 176 | for (i = 0; i < nr_irqs; i++) { |
177 | struct irq_desc *desc = irq_desc + i; | 177 | struct irq_desc *desc = irq_to_desc(i); |
178 | unsigned int status; | 178 | unsigned int status; |
179 | 179 | ||
180 | spin_lock_irq(&desc->lock); | 180 | spin_lock_irq(&desc->lock); |