devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Murali Karicheri <m-karicheri2@ti.com>
To: bhelgaas@google.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH next v2 2/2] PCI: keystone: remove unnecessary goto statement
Date: Mon, 11 Apr 2016 10:50:31 -0400	[thread overview]
Message-ID: <1460386231-8377-2-git-send-email-m-karicheri2@ti.com> (raw)
In-Reply-To: <1460386231-8377-1-git-send-email-m-karicheri2@ti.com>

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 <m-karicheri2@ti.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>

---
 v2 - removed an unnecessary extra line added in the previous version
 v1 - same as before initial version
 drivers/pci/host/pci-keystone.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
index 299f2f0..0234828 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;
 }
 
-- 
1.9.1

  reply	other threads:[~2016-04-11 14:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 14:50 [PATCH next v2 1/2] PCI: keystone: add pci error irq handler Murali Karicheri
2016-04-11 14:50 ` Murali Karicheri [this message]
2016-04-20  1:06   ` [PATCH next v2 2/2] PCI: keystone: remove unnecessary goto statement Bjorn Helgaas
2016-04-20 14:29     ` Murali Karicheri
     [not found] ` <1460386231-8377-1-git-send-email-m-karicheri2-l0cyMroinI0@public.gmane.org>
2016-04-20  1:03   ` [PATCH next v2 1/2] PCI: keystone: add pci error irq handler Bjorn Helgaas
2016-04-20 14:13     ` Murali Karicheri

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=1460386231-8377-2-git-send-email-m-karicheri2@ti.com \
    --to=m-karicheri2@ti.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /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).