Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1376048
| From | Murali Karicheri <m-karicheri2@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH next v2 2/2] PCI: keystone: remove unnecessary goto statement |
| Date | 2016-04-11 17:00 +0200 |
| Message-ID | <rmLtM-7zE-25@gated-at.bofh.it> (permalink) |
| References | <rmLtM-7zE-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH next v2 2/2] PCI: keystone: remove unnecessary goto statement Murali Karicheri <m-karicheri2@ti.com> - 2016-04-11 17:00 +0200
csiph-web