netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, linux-can@vger.kernel.org,
	sfr@canb.auug.org.au, andreas@gaisler.com
Subject: Re: [PATCH] can: sja1000: fix compilation on x86
Date: Fri, 14 Dec 2012 23:17:03 +0100	[thread overview]
Message-ID: <50CBA55F.6030300@pengutronix.de> (raw)
In-Reply-To: <20121214.163758.465958297963655994.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

On 12/14/2012 10:37 PM, David Miller wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Date: Fri, 14 Dec 2012 22:33:44 +0100
> 
>> @@ -121,7 +121,7 @@ static int sja1000_ofp_probe(struct platform_device *ofdev)
>>  	}
>>  
>>  	irq = irq_of_parse_and_map(np, 0);
>> -	if (irq == NO_IRQ) {
>> +	if (irq <= 0) {
>>  		dev_err(&ofdev->dev, "no irq found\n");
>>  		err = -ENODEV;
>>  		goto exit_unmap_mem;
> 
> I don't see anything existing which says this is the proper
> transformation.
> 
> There is no consistency at all for the tests of the return
> value of irq_of_parse_and_map().

Right. And the current status of NO_IRQ doesn't help much.

> And if anything testing against zero is the correct thing to
> do, universally.

I've looked at the implementation of irq_of_parse_and_map() (both the
generic and sparc one), they both return 0 on failure. Because there are
some arch that define NO_IRQ being not 0, sparc (0xffffffff) and arm
(-1), I though testing against <= 0 would be a good idea.

> I'm not applying this or pulling from your tree, sorry.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

      reply	other threads:[~2012-12-14 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 21:33 pull-request: can 2012-12-14 Marc Kleine-Budde
2012-12-14 21:33 ` [PATCH] can: sja1000: fix compilation on x86 Marc Kleine-Budde
2012-12-14 21:37   ` David Miller
2012-12-14 22:17     ` Marc Kleine-Budde [this message]

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=50CBA55F.6030300@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-can@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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
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;
as well as URLs for NNTP newsgroup(s).