From: Bjorn Helgaas <bhelgaas@google.com>
To: Fabio Estevam <fabio.estevam@freescale.com>
Cc: linux-pci@vger.kernel.org, Lucas Stach <l.stach@pengutronix.de>
Subject: Re: [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence
Date: Sat, 15 Aug 2015 11:11:34 -0500 [thread overview]
Message-ID: <20150815161134.GH26431@google.com> (raw)
In-Reply-To: <1439487436-26989-1-git-send-email-fabio.estevam@freescale.com>
On Thu, Aug 13, 2015 at 02:37:13PM -0300, Fabio Estevam wrote:
> 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>
I applied 1-3 to pci/misc for v4.3, thanks!
I dropped 4 ("PCI: ats: Use BUG_ON()") because I reworked
pci_restore_ats_state() so it no longer looks for the ATS capability:
https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?h=pci/iommu&id=a021f3019db7
> ---
> 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
>
prev parent reply other threads:[~2015-08-15 16:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=20150815161134.GH26431@google.com \
--to=bhelgaas@google.com \
--cc=fabio.estevam@freescale.com \
--cc=l.stach@pengutronix.de \
--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).