Re: cant compile on alpha with gcc-4.3 and CONFIG_ALPHA_NAUTILUS

From: Ivan Kokshaysky
Date: Sun Jan 11 2009 - 16:05:30 EST


On Sat, Jan 10, 2009 at 11:54:15AM +0000, Daniel Drake wrote:
> To fix this, we could remove -Werror or we could restructure the irq_srm
> code so that it is only compiled on systems that use it. One small
> function (srm_device_interrupt) is used all over the place so would have
> to be separated. Patch attached, which has been compile-tested on nautilus.
> The disadvantage is that srm_device_interrupt() is now built on all alpha
> sys types, but it is so small that it doesn't seem worth creating its own
> file or creating ifdef spaghetti.
>
> Thoughts?

Your patch looks fine, but there is simpler fix which makes the compiler
to optimize problematic code away on systems with NR_IRQS <= 16.

Ivan.

diff --git a/arch/alpha/kernel/irq_srm.c b/arch/alpha/kernel/irq_srm.c
index 3221201..a03fbca 100644
--- a/arch/alpha/kernel/irq_srm.c
+++ b/arch/alpha/kernel/irq_srm.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/