From patchwork Tue Mar 22 19:52:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 64198 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2279760lbc; Tue, 22 Mar 2016 12:53:23 -0700 (PDT) X-Received: by 10.98.13.77 with SMTP id v74mr57083409pfi.162.1458676403526; Tue, 22 Mar 2016 12:53:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si982058pfi.38.2016.03.22.12.53.23; Tue, 22 Mar 2016 12:53:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbcCVTxV (ORCPT + 7 others); Tue, 22 Mar 2016 15:53:21 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:39973 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751893AbcCVTxU (ORCPT ); Tue, 22 Mar 2016 15:53:20 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id u2MJqpMS001776; Tue, 22 Mar 2016 14:52:51 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id u2MJqpsD023407; Tue, 22 Mar 2016 14:52:51 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Tue, 22 Mar 2016 14:52:51 -0500 Received: from ula0868495.am.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u2MJqorr022150; Tue, 22 Mar 2016 14:52:51 -0500 From: Murali Karicheri To: , , , , Subject: [PATCH next 2/2] PCI: keystone: remove unnecessary goto statement Date: Tue, 22 Mar 2016 15:52:58 -0400 Message-ID: <1458676378-24377-2-git-send-email-m-karicheri2@ti.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1458676378-24377-1-git-send-email-m-karicheri2@ti.com> References: <1458676378-24377-1-git-send-email-m-karicheri2@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Fix the misuse of goto statement in ks_pcie_get_irq_controller_info() as simple return is more appropriate for this function. While at it add an error log for absence of interrupt controller node. Signed-off-by: Murali Karicheri Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala Cc: Bjorn Helgaas --- drivers/pci/host/pci-keystone.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe devicetree" 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/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index 299f2f0..3563b9c 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c @@ -181,11 +181,13 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie, *np_temp = of_find_node_by_name(np_pcie, controller); if (!(*np_temp)) { dev_err(dev, "Node for %s is absent\n", controller); - goto out; + return ret; } temp = of_irq_count(*np_temp); - if (!temp) - goto out; + if (!temp) { + dev_err(dev, "No entries in %s\n", controller); + return ret; + } if (temp > max_host_irqs) dev_warn(dev, "Too many %s interrupts defined %u\n", (legacy ? "legacy" : "MSI"), temp); @@ -203,7 +205,6 @@ static int ks_pcie_get_irq_controller_info(struct keystone_pcie *ks_pcie, *num_irqs = temp; ret = 0; } -out: return ret; } @@ -231,6 +232,7 @@ static void ks_pcie_setup_interrupts(struct keystone_pcie *ks_pcie) /* enable error interrupt */ if (ks_pcie->error_irq > 0) ks_dw_pcie_enable_error_irq(ks_pcie->va_app_base); + } /*