]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
alpha: nautilus - fix compile failure with gcc-4.3
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>
Thu, 15 Jan 2009 21:51:17 +0000 (13:51 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Jan 2009 00:39:40 +0000 (16:39 -0800)
init_srm_irq() deals with irq's #16 and above, but size of irq_desc
array on nautilus and some other system types is 16. So gcc-4.3
complains that "array subscript is above array bounds", even though
this function is never called on those systems.

This adds a check for NR_IRQS <= 16, which effectively optimizes
init_srm_irq() code away on problematic platforms.

Thanks to Daniel Drake <dsd@gentoo.org> for detailed analysis
of the problem.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/alpha/kernel/irq_srm.c

index 32212014fbe91632e9bb80b5307725d16e758d1a..a03fbca4940eb0d0881b4d197cd3e84a3cf2b68a 100644 (file)
@@ -63,6 +63,8 @@ init_srm_irqs(long max, unsigned long ignore_mask)
 {
        long i;
 
+       if (NR_IRQS <= 16)
+               return;
        for (i = 16; i < max; ++i) {
                if (i < 64 && ((ignore_mask >> i) & 1))
                        continue;