From patchwork Sat Jul 17 17:21:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 59145 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E3311B70A5 for ; Sun, 18 Jul 2010 03:23:22 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760074Ab0GQRXS (ORCPT ); Sat, 17 Jul 2010 13:23:18 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:61343 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756047Ab0GQRXR (ORCPT ); Sat, 17 Jul 2010 13:23:17 -0400 Received: by wyb42 with SMTP id 42so2969256wyb.19 for ; Sat, 17 Jul 2010 10:23:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=V3Nm1A3ahb1YhV1tauO9jjwvuDGzDlXABdpv1Ss3ZwI=; b=ARws9hDMqC2EdkGMuFa5/aMfMYwJmJ6rFD5VDD0nNrCo4Ci8Vu6dki7Xt59zdvkbxz xmVsJ31U2bm/fDxed6X7Le7f+VJCRZMQX2vDNo7U5cILEd0IGXnM5sPkpsJY7+vncjjv EwacyLVJG7TsFpwlHRWq9rPjG5CfsrMDG3c20= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=bdQ7Js2M13pd376CM69gT4ZC1UJXJp/HEaULUDe9pfIAubo9hfxJkZ2oUvJXfQ2/Ux MK/EUVAaBYiK/RjwEK0wgk8JkoRSEpuncDNUDrP8PbPMdfTzrDVFcVGfmkr90wENN7iy 9ObXu1ZIiLzNILOiAK/lylOPw+2oOmH/MRc88= Received: by 10.227.129.84 with SMTP id n20mr2156380wbs.61.1279387394447; Sat, 17 Jul 2010 10:23:14 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id a1sm24914148wbb.20.2010.07.17.10.22.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Jul 2010 10:23:13 -0700 (PDT) Date: Sat, 17 Jul 2010 19:21:28 +0200 From: Dan Carpenter To: netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org Subject: [patch] arcnet: fix signed bug in probe function Message-ID: <20100717172127.GI17585@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org probe_irq_off() returns the first irq found or if two irqs are found then it returns the negative of the first irq found. We can cast dev->irq to an int so that the test for negative values works. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/arcnet/com20020-isa.c b/drivers/net/arcnet/com20020-isa.c index 0402da3..3727282 100644 --- a/drivers/net/arcnet/com20020-isa.c +++ b/drivers/net/arcnet/com20020-isa.c @@ -90,14 +90,14 @@ static int __init com20020isa_probe(struct net_device *dev) outb(0, _INTMASK); dev->irq = probe_irq_off(airqmask); - if (dev->irq <= 0) { + if ((int)dev->irq <= 0) { BUGMSG(D_INIT_REASONS, "Autoprobe IRQ failed first time\n"); airqmask = probe_irq_on(); outb(NORXflag, _INTMASK); udelay(5); outb(0, _INTMASK); dev->irq = probe_irq_off(airqmask); - if (dev->irq <= 0) { + if ((int)dev->irq <= 0) { BUGMSG(D_NORMAL, "Autoprobe IRQ failed.\n"); err = -ENODEV; goto out; diff --git a/drivers/net/arcnet/com90io.c b/drivers/net/arcnet/com90io.c index 4cb4018..eb27976 100644 --- a/drivers/net/arcnet/com90io.c +++ b/drivers/net/arcnet/com90io.c @@ -213,7 +213,7 @@ static int __init com90io_probe(struct net_device *dev) outb(0, _INTMASK); dev->irq = probe_irq_off(airqmask); - if (dev->irq <= 0) { + if ((int)dev->irq <= 0) { BUGMSG(D_INIT_REASONS, "Autoprobe IRQ failed\n"); goto err_out; }