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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Feb 2009 17:53:21 +0000 (09:53 -0800)
commitb0d9586b9f4869c996fc7ed50ac4e0272aace2d0
tree7e195ff065cee974daf0a4e6d421b250d4cb2ae1
parent7796bc5a935113ae7d81876071a118ca9c4cd958
alpha: nautilus - fix compile failure with gcc-4.3

commit 70b66cbfd3316b792a855cb9a2574e85f1a63d0f upstream.

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>
Cc: Tobias Klausmann <klausman@schwarzvogel.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/alpha/kernel/irq_srm.c