From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Paul Walmsley <paul@pwsan.com>
Cc: linux-tegra@vger.kernel.org, linux-arm-kernel@vger.kernel.org,
Alexandre Courbot <gnurou@gmail.com>,
Stephen Warren <swarren@wwwdotorg.org>,
linux-kernel@vger.kernel.org,
Thierry Reding <thierry.reding@gmail.com>,
Hiroshi DOYU <hdoyu@nvidia.com>
Subject: Re: [PATCH 2/3] amba: tegra-ahb: use correct base address for future chip support
Date: Tue, 17 Mar 2015 10:35:03 +0000 [thread overview]
Message-ID: <20150317103503.GT8656@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20150317083221.32662.7448.stgit@baseline>
On Tue, Mar 17, 2015 at 01:32:21AM -0700, Paul Walmsley wrote:
> static inline u32 gizmo_readl(struct tegra_ahb *ahb, u32 offset)
> {
> - return readl(ahb->regs - 4 + offset);
> + return readl(ahb->regs + ahb->offset + offset);
> }
>
> static inline void gizmo_writel(struct tegra_ahb *ahb, u32 value, u32 offset)
> {
> - writel(value, ahb->regs - 4 + offset);
> + writel(value, ahb->regs + ahb->offset + offset);
Rather than storing the offset...
> @@ -262,18 +283,15 @@ static int tegra_ahb_probe(struct platform_device *pdev)
> if (IS_ERR(ahb->regs))
> return PTR_ERR(ahb->regs);
>
> + ad = of_id->data;
> ahb->dev = &pdev->dev;
> + ahb->offset = ad->offset;
What about
ahb->regs += ad->offset;
here and avoid the addition and extra loads on every access.
--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
prev parent reply other threads:[~2015-03-17 10:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20150317083221.32662.14647.stgit@baseline>
2015-03-17 8:32 ` [PATCH 3/3] Documentation: DT bindings: Tegra AHB: note base address change Paul Walmsley
2015-03-17 10:38 ` [PATCHv2 " Russell King - ARM Linux
2015-03-19 15:26 ` Paul Walmsley
2015-03-19 15:42 ` Stephen Warren
2015-03-19 16:17 ` Paul Walmsley
2015-03-19 16:46 ` Paul Walmsley
2015-03-19 16:54 ` Stephen Warren
2015-03-19 17:55 ` Paul Walmsley
2015-03-19 18:28 ` Stephen Warren
2015-03-19 18:46 ` Paul Walmsley
2015-03-17 16:43 ` [PATCH " Stephen Warren
2015-03-19 15:33 ` Paul Walmsley
2015-03-19 15:44 ` Stephen Warren
2015-03-19 16:34 ` Paul Walmsley
2015-03-19 17:46 ` Stephen Warren
2015-03-19 18:42 ` Paul Walmsley
2015-03-19 22:27 ` Stephen Warren
2015-03-17 8:32 ` [PATCH 1/3] amba: tegra-ahb: fix register offsets in the macros Paul Walmsley
2015-03-17 8:32 ` [PATCH 2/3] amba: tegra-ahb: use correct base address for future chip support Paul Walmsley
2015-03-17 10:35 ` Russell King - ARM Linux [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=20150317103503.GT8656@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=gnurou@gmail.com \
--cc=hdoyu@nvidia.com \
--cc=linux-arm-kernel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=swarren@wwwdotorg.org \
--cc=thierry.reding@gmail.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