From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Gregory CLEMENT <gregory.clement@bootlin.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
linux-pci@vger.kernel.org, "Andrew Lunn" <andrew@lunn.ch>,
"Jason Cooper" <jason@lakedaemon.net>,
"Antoine Tenart" <antoine.tenart@bootlin.com>,
"Omri Itach" <omrii@marvell.com>,
"Nadav Haklai" <nadavh@marvell.com>,
"Shadi Ammouri" <shadi@marvell.com>,
"Igal Liberman" <igall@marvell.com>,
"Miquèl Raynal" <miquel.raynal@bootlin.com>,
"Marcin Wojtas" <mw@semihalf.com>,
"Hanna Hawa" <hannah@marvell.com>,
linux-arm-kernel@lists.infradead.org,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH 2/2] PCI: armada8k: Fix clock resource by adding a register clock
Date: Wed, 28 Feb 2018 15:27:57 +0000 [thread overview]
Message-ID: <20180228152756.GV9418@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20180228144704.12947-3-gregory.clement@bootlin.com>
On Wed, Feb 28, 2018 at 03:47:04PM +0100, Gregory CLEMENT wrote:
> @@ -229,6 +230,15 @@ static int armada8k_pcie_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> + if (IS_ERR(pcie->clk_reg) && PTR_ERR(pcie->clk_reg) == -EPROBE_DEFER) {
You do realise this is needlessly complex.
Pointer errors are unique, so:
if (pcie->clk_reg == ERR_PTR(-EPROBE_DEFER)) {
will do the same thing but without the complexity. Transforming the
constant rather than the variable is also a good habbit to get into -
the compiler can optimise transforms to constants, but can't with
variables, so comparisons involving things like endian conversion
should always be done by transforming the constant not the variable.
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
next prev parent reply other threads:[~2018-02-28 15:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-28 14:47 [PATCH 0/2] PCI: armada8k: Fix clock resource for Armada 7K/8K Gregory CLEMENT
2018-02-28 14:47 ` [PATCH 1/2] PCI: armada8k: Remove useless test before clk_disable_unprepare Gregory CLEMENT
2018-02-28 14:47 ` [PATCH 2/2] PCI: armada8k: Fix clock resource by adding a register clock Gregory CLEMENT
2018-02-28 14:53 ` Thomas Petazzoni
2018-02-28 15:37 ` Gregory CLEMENT
2018-02-28 15:27 ` Russell King - ARM Linux [this message]
2018-02-28 15:31 ` Gregory CLEMENT
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=20180228152756.GV9418@n2100.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=antoine.tenart@bootlin.com \
--cc=bhelgaas@google.com \
--cc=gregory.clement@bootlin.com \
--cc=hannah@marvell.com \
--cc=igall@marvell.com \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=miquel.raynal@bootlin.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=omrii@marvell.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=shadi@marvell.com \
--cc=thomas.petazzoni@bootlin.com \
/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).