From: Lucas Stach <l.stach@pengutronix.de>
To: Fabio Estevam <fabio.estevam@freescale.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org
Subject: Re: [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence
Date: Fri, 14 Aug 2015 10:49:57 +0200 [thread overview]
Message-ID: <1439542197.13210.37.camel@pengutronix.de> (raw)
In-Reply-To: <1439487436-26989-1-git-send-email-fabio.estevam@freescale.com>
Am Donnerstag, den 13.08.2015, 14:37 -0300 schrieb Fabio Estevam:
> 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.
>
I don't really see that this helps code clarity/readability, but it
certainly also doesn't make things harder to follow.
So if Bjorn wants to take the series I'm okay with this going in.
Regards,
Lucas
> 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)
--
Pengutronix e.K. | Lucas Stach |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2015-08-14 8:50 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 ` Lucas Stach [this message]
2015-08-15 16:11 ` [PATCH 1/4] PCI: imx6: Simplify a trivial if-return sequence Bjorn Helgaas
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=1439542197.13210.37.camel@pengutronix.de \
--to=l.stach@pengutronix.de \
--cc=bhelgaas@google.com \
--cc=fabio.estevam@freescale.com \
--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).