Subject: Re: [PATCH 2/2 v2] mpic_u3msi: mpic_u3msi: failed allocation unnoticed

From: Benjamin Herrenschmidt <[email-masked]>
Date: Thu, 24 Apr 2008 10:42:29 +1000

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.