Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932988AbZLPS7p (ORCPT ); Wed, 16 Dec 2009 13:59:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759949AbZLPS7h (ORCPT ); Wed, 16 Dec 2009 13:59:37 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:60083 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762882AbZLPS73 (ORCPT ); Wed, 16 Dec 2009 13:59:29 -0500 X-Auth-Info: Zwp9ph72Tv1+lIV8f3Pmy4FBhXrjBoRNqVV8UFWu4W0= Message-ID: <4B292DDE.6080906@grandegger.com> Date: Wed, 16 Dec 2009 19:58:38 +0100 From: Wolfgang Grandegger User-Agent: Thunderbird 2.0.0.23 (X11/20090812) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Uwe_Kleine-K=F6nig?= CC: linux-kernel@vger.kernel.org, David Vrabel , Greg Kroah-Hartman , Urs Thuermann , Oliver Hartkopp , "David S. Miller" , Kurt Van Dijck , netdev@vger.kernel.org Subject: Re: [PATCH 4/7] can/at91: don't check platform_get_irq's return value against zero References: <1260979809-24811-1-git-send-email-u.kleine-koenig@pengutronix.de> <1260979809-24811-2-git-send-email-u.kleine-koenig@pengutronix.de> <1260979809-24811-3-git-send-email-u.kleine-koenig@pengutronix.de> <1260979809-24811-4-git-send-email-u.kleine-koenig@pengutronix.de> In-Reply-To: <1260979809-24811-4-git-send-email-u.kleine-koenig@pengutronix.de> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1675 Lines: 46 Uwe Kleine-K?nig wrote: > platform_get_irq returns -ENXIO on failure, so !irq was probably > always true. Better use (int)irq <= 0. Note that a return value of > zero is still handled as error even though this could mean irq0. > > This is a followup to 305b3228f9ff4d59f49e6d34a7034d44ee8ce2f0 that > changed the return value of platform_get_irq from 0 to -ENXIO on error. > > Signed-off-by: Uwe Kleine-K?nig > Cc: David Vrabel > Cc: Greg Kroah-Hartman > Cc: Urs Thuermann > Cc: Oliver Hartkopp > Cc: David S. Miller > Cc: Wolfgang Grandegger > Cc: Kurt Van Dijck > Cc: netdev@vger.kernel.org Signed-off-by: Wolfgang Grandegger > --- > drivers/net/can/at91_can.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c > index cbe3fce..631d404 100644 > --- a/drivers/net/can/at91_can.c > +++ b/drivers/net/can/at91_can.c > @@ -1037,7 +1037,7 @@ static int __init at91_can_probe(struct platform_device *pdev) > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > irq = platform_get_irq(pdev, 0); > - if (!res || !irq) { > + if (!res || irq <= 0) { > err = -ENODEV; > goto exit_put; > } Thanks, Wolfgang. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/