LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Matt Sealey <matt@genesi-usa.com>
To: avorontsov@ru.mvista.com
Cc: Jeff Garzik <jgarzik@pobox.com>,
	linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org,
	linux-ide@vger.kernel.org, Li Yang <leoli@freescale.com>,
	Wang Jian <lark@linux.net.cn>
Subject: Re: [PATCH] pata_of_platform: fix no irq handling
Date: Mon, 06 Oct 2008 15:41:19 -0500	[thread overview]
Message-ID: <48EA77EF.6080502@genesi-usa.com> (raw)
In-Reply-To: <20081006172653.GA26427@oksana.dev.rtsoft.ru>

There is a simple problem with the patch which is that an "IRQ 0" can and does
actually exist on a bunch of platforms, at least to the best of my knowledge.

Checking for -1 (which means for definite, no irq at all, because it is
totally unambiguous, as a -1 IRQ numbering is "impossible") is more correct.

The problem is the check against an unsigned value for interrupts (is there
any reason why you would need 4 billion interrupts possible instead of just
2 billion?) although I must say, the patch will work, and probably 99.9999999%
of people will never see a problem with it :)

-- 
Matt Sealey <matt@genesi-usa.com>
Genesi, Manager, Developer Relations

Anton Vorontsov wrote:
> When no irq specified the pata_of_platform fills the irq_res with -1,
> which is wrong to do for two reasons:
> 
> 1. By definition, 'no irq' should be IRQ 0, not some negative integer;
> 2. pata_platform checks for irq_res.start > 0, but since irq_res.start
>    is unsigned type, the check will be true for `-1'.
> 
> Reported-by: Steven A. Falco <sfalco@harris.com>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> 
> Resending again...
> 
>  drivers/ata/pata_of_platform.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
> index 408da30..1f18ad9 100644
> --- a/drivers/ata/pata_of_platform.c
> +++ b/drivers/ata/pata_of_platform.c
> @@ -52,7 +52,7 @@ static int __devinit pata_of_platform_probe(struct of_device *ofdev,
>  
>  	ret = of_irq_to_resource(dn, 0, &irq_res);
>  	if (ret == NO_IRQ)
> -		irq_res.start = irq_res.end = -1;
> +		irq_res.start = irq_res.end = 0;
>  	else
>  		irq_res.flags = 0;
>  

  reply	other threads:[~2008-10-06 20:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-06 17:26 Anton Vorontsov
2008-10-06 20:41 ` Matt Sealey [this message]
2008-10-06 21:32   ` Anton Vorontsov
2008-10-07  1:30     ` Tejun Heo
2008-10-07  9:18       ` Wang Jian
2008-10-07  9:26       ` Anton Vorontsov
2008-10-07 10:04         ` Benjamin Herrenschmidt
2008-10-07  9:37       ` Alan Cox
2008-10-08  8:40         ` David Woodhouse
2008-10-08  9:00           ` Alan Cox
2008-10-08  9:59             ` Geert Uytterhoeven
2008-10-08 10:27               ` Alan Cox
2008-10-10 17:55               ` Paul Mundt
2008-10-13  6:56 ` Tejun Heo
2008-10-13 13:27   ` Jeff Garzik
2008-10-13 13:53     ` Tejun Heo
2008-10-13 14:02     ` I have returned! Alan Cox
2008-10-16  9:40       ` Jeff Garzik
2008-10-13 14:04     ` [PATCH] fusion: remove dead mpt lan code Alan Cox
2008-10-13 14:05     ` [PATCH] mptsas: remove pointless null check Alan Cox
2008-10-13 14:22       ` James Bottomley
2008-10-13 14:37         ` Alan Cox
2008-10-13 23:27   ` [PATCH] pata_of_platform: fix no irq handling Benjamin Herrenschmidt

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=48EA77EF.6080502@genesi-usa.com \
    --to=matt@genesi-usa.com \
    --cc=avorontsov@ru.mvista.com \
    --cc=jgarzik@pobox.com \
    --cc=lark@linux.net.cn \
    --cc=leoli@freescale.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --subject='Re: [PATCH] pata_of_platform: fix no irq handling' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).