From patchwork Fri Nov 14 22:19:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5309901 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 66B13C11AC for ; Fri, 14 Nov 2014 22:21:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3D2F20120 for ; Fri, 14 Nov 2014 22:21:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C73312010B for ; Fri, 14 Nov 2014 22:21:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XpPDG-0000Ce-FY; Fri, 14 Nov 2014 22:19:30 +0000 Received: from mail-ig0-f177.google.com ([209.85.213.177]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XpPDD-00084S-Hs for linux-arm-kernel@lists.infradead.org; Fri, 14 Nov 2014 22:19:27 +0000 Received: by mail-ig0-f177.google.com with SMTP id uq10so1065597igb.10 for ; Fri, 14 Nov 2014 14:19:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=i7uWqArBoj8qxEvBLViTUOfT9gCSgNPsNB8gzWcPQa4=; b=FUSbpQNw/tfdLo2rio7S28Df54erGbRuHBJ7BzSucj/u+glexheeXgSn+wEqzA9VIc /42e+an7ie5Xx8ehYqhm4e3kj0vMu6DcWeb6h8VwHHXFZWvh/3bBRcnRYbo5WrjFNEcS 5crqI7vBDH7NNqDtr6mH+eOu1/rwEjs0GMv7tpBaC3ag8JtPCQduXSX5TLCoSyrB5JAZ pjxGG2GiU8NsrfmrxpbMTkJPBovLywqm+9WBodElLJP5YoVbts7miKCow530LZMXKltf q1dpxuFxg+mE8pbek5vX/lMSH2B/zF9n7rXp5+hmU0WE3E949aOdZwtRxKPEkEyUwEO+ htGQ== X-Gm-Message-State: ALoCoQnate5Bf/y3sfqrK7vn9cLTjGKFk86JEEMuSv9ntccjAt0eVefONdXhAgzdX9PJuF2e1kWz X-Received: by 10.107.155.209 with SMTP id d200mr13570450ioe.12.1416003545972; Fri, 14 Nov 2014 14:19:05 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:8c0e:c406:dbcd:b83b]) by mx.google.com with ESMTPSA id 40sm14993341iom.43.2014.11.14.14.19.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Nov 2014 14:19:05 -0800 (PST) Date: Fri, 14 Nov 2014 14:19:03 -0800 From: Dmitry Torokhov To: Murali Karicheri Subject: [PATCH] PCI: keystone: fix error handling of irq_of_parse_and_map Message-ID: <20141114221903.GA38539@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141114_141927_637840_4A11D581 X-CRM114-Status: GOOD ( 11.55 ) X-Spam-Score: -0.7 (/) Cc: Arnd Bergmann , Wolfram Sang , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Santosh Shilimkar , Bjorn Helgaas , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works. Signed-off-by: Dmitry Torokhov Acked-By: Murali Karicheri --- Not tested, found by casual code inspection. drivers/pci/host/pci-keystone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index 8a27078..f2bd48d 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c @@ -197,7 +197,7 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie, */ for (temp = 0; temp < max_host_irqs; temp++) { host_irqs[temp] = irq_of_parse_and_map(*np_temp, temp); - if (host_irqs[temp] < 0) + if (!host_irqs[temp]) break; } if (temp) {