]>
Commit | Line | Data |
---|---|---|
3414f2ca GKH |
1 | From 70b66cbfd3316b792a855cb9a2574e85f1a63d0f Mon Sep 17 00:00:00 2001 |
2 | From: Ivan Kokshaysky <ink@jurassic.park.msu.ru> | |
3 | Date: Thu, 15 Jan 2009 13:51:17 -0800 | |
4 | Subject: alpha: nautilus - fix compile failure with gcc-4.3 | |
5 | ||
6 | From: Ivan Kokshaysky <ink@jurassic.park.msu.ru> | |
7 | ||
8 | commit 70b66cbfd3316b792a855cb9a2574e85f1a63d0f upstream. | |
9 | ||
10 | init_srm_irq() deals with irq's #16 and above, but size of irq_desc | |
11 | array on nautilus and some other system types is 16. So gcc-4.3 | |
12 | complains that "array subscript is above array bounds", even though | |
13 | this function is never called on those systems. | |
14 | ||
15 | This adds a check for NR_IRQS <= 16, which effectively optimizes | |
16 | init_srm_irq() code away on problematic platforms. | |
17 | ||
18 | Thanks to Daniel Drake <dsd@gentoo.org> for detailed analysis | |
19 | of the problem. | |
20 | ||
21 | Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> | |
22 | Cc: Richard Henderson <rth@twiddle.net> | |
23 | Signed-off-by: Andrew Morton <akpm@linux-foundation.org> | |
24 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | |
25 | Cc: Tobias Klausmann <klausman@schwarzvogel.de> | |
26 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
27 | ||
28 | --- | |
29 | arch/alpha/kernel/irq_srm.c | 2 ++ | |
30 | 1 file changed, 2 insertions(+) | |
31 | ||
32 | --- a/arch/alpha/kernel/irq_srm.c | |
33 | +++ b/arch/alpha/kernel/irq_srm.c | |
34 | @@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ig | |
35 | { | |
36 | long i; | |
37 | ||
38 | + if (NR_IRQS <= 16) | |
39 | + return; | |
40 | for (i = 16; i < max; ++i) { | |
41 | if (i < 64 && ((ignore_mask >> i) & 1)) | |
42 | continue; |