On 10/14/2010 06:27 PM, Grant Likely wrote:
On Thu, Oct 14, 2010 at 3:02 PM, David Daney<ddaney@xxxxxxxxxxxxxxxxxx> wrote:
[...]
+#define NO_IRQ UINT_MAX
Really? The verdict came down a long time ago that 0 is to be the
value that means no irq, and only a few architectures still define
NO_IRQ as -1. It is assumed that the architectures which do not
define NO_IRQ use 0 as the invalid value. Mostly notably x86 does not
define NO_IRQ, and Linus nack'd the patch to add it.
I was not part of that discussion.
I would however note, that all the irq functions return unsigned, so a
value of -1 is meaningless. Also my understanding is that 8259 based
systems use the values of 0 - 15 as the interrupt numbers, making 0
unavailable for use as NO_IRQ.
Given these constraints, UINT_MAX would seem to be a good value. It has
to be defined as something *and* have global visibility, because it is
part of the OF irq mapping functions API.
David Daney