All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
	"Jason Cooper" <jason@lakedaemon.net>,
	"Antoine Tenart" <antoine.tenart@bootlin.com>,
	linux-pci@vger.kernel.org, "Hanna Hawa" <hannah@marvell.com>,
	"Omri Itach" <omrii@marvell.com>,
	"Nadav Haklai" <nadavh@marvell.com>,
	"Shadi Ammouri" <shadi@marvell.com>,
	linux-arm-kernel@lists.infradead.org,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Miquèl Raynal" <miquel.raynal@bootlin.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Marcin Wojtas" <mw@semihalf.com>,
	"Igal Liberman" <igall@marvell.com>,
	"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 16:31:16 +0100	[thread overview]
Message-ID: <878tbdf7wb.fsf@bootlin.com> (raw)
In-Reply-To: <20180228152756.GV9418@n2100.armlinux.org.uk> (Russell King's message of "Wed, 28 Feb 2018 15:27:57 +0000")

SGkgUnVzc2VsbCBLaW5nLAogCiBPbiBtZXIuLCBmw6l2ci4gMjggMjAxOCwgUnVzc2VsbCBLaW5n
IC0gQVJNIExpbnV4IDxsaW51eEBhcm1saW51eC5vcmcudWs+IHdyb3RlOgoKPiBPbiBXZWQsIEZl
YiAyOCwgMjAxOCBhdCAwMzo0NzowNFBNICswMTAwLCBHcmVnb3J5IENMRU1FTlQgd3JvdGU6Cj4+
IEBAIC0yMjksNiArMjMwLDE1IEBAIHN0YXRpYyBpbnQgYXJtYWRhOGtfcGNpZV9wcm9iZShzdHJ1
Y3QgcGxhdGZvcm1fZGV2aWNlICpwZGV2KQo+PiAgCWlmIChyZXQ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zeW5jIGF0IDguOE1icHMgZG93biA2MzBrYnBzIHVwCj4gQWNjb3Jk
aW5nIHRvIHNwZWVkdGVzdC5uZXQ6IDguMjFNYnBzIGRvd24gNTEwa2JwcyB1cAoKLS0gCkdyZWdv
cnkgQ2xlbWVudCwgQm9vdGxpbiAoZm9ybWVybHkgRnJlZSBFbGVjdHJvbnMpCkVtYmVkZGVkIExp
bnV4IGFuZCBLZXJuZWwgZW5naW5lZXJpbmcKaHR0cDovL2Jvb3RsaW4uY29tCgpfX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpsaW51eC1hcm0ta2VybmVsIG1h
aWxpbmcgbGlzdApsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmcKaHR0cDovL2xp
c3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eC1hcm0ta2VybmVsCg==

WARNING: multiple messages have this Message-ID (diff)
From: gregory.clement@bootlin.com (Gregory CLEMENT)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] PCI: armada8k: Fix clock resource by adding a register clock
Date: Wed, 28 Feb 2018 16:31:16 +0100	[thread overview]
Message-ID: <878tbdf7wb.fsf@bootlin.com> (raw)
In-Reply-To: <20180228152756.GV9418@n2100.armlinux.org.uk> (Russell King's message of "Wed, 28 Feb 2018 15:27:57 +0000")

Hi Russell King,
 
 On mer., f?vr. 28 2018, Russell King - ARM Linux <linux@armlinux.org.uk> wrote:

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

Thanks for the tip, I will use it in the next version.

Gregory

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

-- 
Gregory Clement, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com

  reply	other threads:[~2018-02-28 15:31 UTC|newest]

Thread overview: 14+ 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 ` 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   ` 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:47   ` Gregory CLEMENT
2018-02-28 14:53   ` Thomas Petazzoni
2018-02-28 14:53     ` Thomas Petazzoni
2018-02-28 15:37     ` Gregory CLEMENT
2018-02-28 15:37       ` Gregory CLEMENT
2018-02-28 15:27   ` Russell King - ARM Linux
2018-02-28 15:27     ` Russell King - ARM Linux
2018-02-28 15:31     ` Gregory CLEMENT [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=878tbdf7wb.fsf@bootlin.com \
    --to=gregory.clement@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=bhelgaas@google.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=linux@armlinux.org.uk \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.