Google
  Web www.spinics.net

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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/
_______________________________________________
linux-usb-devel@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[Home]     [Video for Linux]     [Photo]     [Yosemite Forum]     [Yosemite Photos]    [Video Projectors]     [PDAs]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [Free Dating]

  Powered by Linux