]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.27.14/alpha-nautilus-fix-compile-failure-with-gcc-4.3.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.14 / alpha-nautilus-fix-compile-failure-with-gcc-4.3.patch
CommitLineData
3414f2ca
GKH
1From 70b66cbfd3316b792a855cb9a2574e85f1a63d0f Mon Sep 17 00:00:00 2001
2From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
3Date: Thu, 15 Jan 2009 13:51:17 -0800
4Subject: alpha: nautilus - fix compile failure with gcc-4.3
5
6From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
7
8commit 70b66cbfd3316b792a855cb9a2574e85f1a63d0f upstream.
9
10init_srm_irq() deals with irq's #16 and above, but size of irq_desc
11array on nautilus and some other system types is 16. So gcc-4.3
12complains that "array subscript is above array bounds", even though
13this function is never called on those systems.
14
15This adds a check for NR_IRQS <= 16, which effectively optimizes
16init_srm_irq() code away on problematic platforms.
17
18Thanks to Daniel Drake <dsd@gentoo.org> for detailed analysis
19of the problem.
20
21Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
22Cc: Richard Henderson <rth@twiddle.net>
23Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
24Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
25Cc: Tobias Klausmann <klausman@schwarzvogel.de>
26Signed-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;