Re: [PATCH 1/5] USB: Make usb _hcd_irq work for multi-role USB controllers w/ shared irq

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.ports.ppc64.devel
Message-ID <[email protected]>
On Saturday 24 November 2007, Alan Cox wrote:
> > 
> > What about for platforms where irq 0 is a valid irq?
> 
> There are no such platforms. Linus made that absolutely clear every time
> this came up before
> 
>         0       -       No IRQ
> 
> A platform with a physical or bus IRQ of 0 needs to remap it to a
> different constant.

However it's also common practice to use negative numbers to
flag "this is no IRQ" ... avoiding all confusions with zero.

  - platform_get_irq(), platform_get_irq_byname() ... never
    return zero, they return irq (positive) or errno

  - PNP initializes invalid IRQs to "-1", and pnp_check_irq()
    handles irq zero as in-range

  - I'm sure I've seen negative numbers used elsewhere too

Something like

  #define is_valid_irq(x) ((x) >= 0)

would work better than expecting sudden agreement everywhere
about a single number representing "this is not an IRQ".

- Dave


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.