public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell•net>
To: Alan Cox <alan@lxorguk•ukuu.org.uk>
Cc: akpm@osdl•org, Greg KH <gregkh@suse•de>,
	linux-usb-devel@lists•sourceforge.net, linuxppc-dev@ozlabs•org
Subject: Re: [linux-usb-devel] [PATCH 1/5] USB: Make usb_hcd_irq work for multi-role USB	controllers w/ shared irq
Date: Sat, 24 Nov 2007 09:50:40 -0800	[thread overview]
Message-ID: <200711240950.41235.david-b@pacbell.net> (raw)
In-Reply-To: <20071124170307.773d7317@the-village.bc.nu>

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

  parent reply	other threads:[~2007-11-24 17:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-24  0:24 [PATCH 0/5] Review request: Cypress c67x00 OTG controller Grant Likely
2007-11-24  0:24 ` [PATCH 1/5] USB: Make usb_hcd_irq work for multi-role USB controllers w/ shared irq Grant Likely
2007-11-24  5:10   ` Greg KH
2007-11-24 17:03     ` [linux-usb-devel] " Alan Cox
2007-11-24 17:15       ` Grant Likely
2007-11-24 17:50       ` David Brownell [this message]
2007-11-24 19:06   ` David Brownell
2007-11-24 19:28     ` Grant Likely
2007-11-24  0:24 ` [PATCH 2/5] USB: Add Cypress c67x00 low level interface code Grant Likely
2007-11-24 19:39   ` David Brownell
2007-11-24  0:24 ` [PATCH 3/5] USB: add Cypress c67x00 OTG controller core driver Grant Likely
2007-11-24  0:24 ` [PATCH 4/5] USB: add Cypress c67x00 OTG controller HCD driver Grant Likely
2007-11-24  3:56   ` [linux-usb-devel] " Alan Stern
2007-11-24  0:24 ` [PATCH 5/5] USB: Add Cypress c67x00 OTG controller driver to Kconfig and Makefiles Grant Likely
2007-11-24 20:12   ` David Brownell
2007-11-24 20:20     ` Grant Likely
2007-11-24 21:03       ` David Brownell
2007-11-24 21:13         ` Grant Likely
2007-11-24 17:57 ` [PATCH 0/5] Review request: Cypress c67x00 OTG controller David Brownell
2007-11-24 19:27   ` Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200711240950.41235.david-b@pacbell.net \
    --to=david-b@pacbell$(echo .)net \
    --cc=akpm@osdl$(echo .)org \
    --cc=alan@lxorguk$(echo .)ukuu.org.uk \
    --cc=gregkh@suse$(echo .)de \
    --cc=linux-usb-devel@lists$(echo .)sourceforge.net \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox