linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence
@ 2015-08-13 17:37 Fabio Estevam
  2015-08-13 17:37 ` [PATCH 2/4] PCI: dra7xx: Remove unneeded use of IS_ERR_VALUE() Fabio Estevam
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Fabio Estevam @ 2015-08-13 17:37 UTC (permalink / raw)
  To: bhelgaas; +Cc: linux-pci, Fabio Estevam, Lucas Stach

Simplify a trivial if-return sequence by combining it with a
preceding function call.

The semantic patch that makes this change is available
in scripts/coccinelle/misc/simple_return.cocci.

Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/pci/host/pci-imx6.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 233a196..8f3a981 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -117,11 +117,7 @@ static int pcie_phy_wait_ack(void __iomem *dbi_base, int addr)
 	val = addr << PCIE_PHY_CTRL_DATA_LOC;
 	writel(val, dbi_base + PCIE_PHY_CTRL);
 
-	ret = pcie_phy_poll_ack(dbi_base, 0);
-	if (ret)
-		return ret;
-
-	return 0;
+	return pcie_phy_poll_ack(dbi_base, 0);
 }
 
 /* Read from the 16-bit PCIe PHY control registers (not memory-mapped) */
@@ -148,11 +144,7 @@ static int pcie_phy_read(void __iomem *dbi_base, int addr , int *data)
 	/* deassert Read signal */
 	writel(0x00, dbi_base + PCIE_PHY_CTRL);
 
-	ret = pcie_phy_poll_ack(dbi_base, 0);
-	if (ret)
-		return ret;
-
-	return 0;
+	return pcie_phy_poll_ack(dbi_base, 0);
 }
 
 static int pcie_phy_write(void __iomem *dbi_base, int addr, int data)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-15 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13 17:37 [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence Fabio Estevam
2015-08-13 17:37 ` [PATCH 2/4] PCI: dra7xx: Remove unneeded use of IS_ERR_VALUE() Fabio Estevam
2015-08-13 17:37 ` [PATCH 3/4] PCI: spear: Use BUG_ON() Fabio Estevam
2015-08-13 17:37 ` [PATCH 4/4] PCI: ats: " Fabio Estevam
2015-08-14  8:49 ` [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence Lucas Stach
2015-08-15 16:11 ` Bjorn Helgaas

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).