Re: [PATCH 2/2 v2] mpic_u3msi: mpic_u3msi: failed allocationunnoticed

From: Benjamin Herrenschmidt
Date: Wed Apr 23 2008 - 20:42:59 EST



On Thu, 2008-04-24 at 09:36 +1000, Michael Ellerman wrote:
>
> I think the real bug is that we're using irq_hw_number_t to represent
> something which isn't. At the end of the day we have to stash the
> hwirq
> into the MSI message data, which is a u32.
>
> I guess we could imagine a driver that does something magic to allow
> it
> to put something bigger than a u32 in the MSI message, but I doubt it.
>
> So I think ïmpic_msi_alloc_hwirqs() should return a long, which allows
> it to return a full u32 plus the negative error values.

Until it's used on 32 bits...

Make it return an int error code and pass the hwirq elsewhere or use the
"illegal" hwirq number (each PIC defines one) as the error return.

Cheers,
Ben.


--
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/