lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150317103503.GT8656@n2100.arm.linux.org.uk>
Date:	Tue, 17 Mar 2015 10:35:03 +0000
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Paul Walmsley <paul@...an.com>
Cc:	linux-tegra@...r.kernel.org, linux-arm-kernel@...r.kernel.org,
	Alexandre Courbot <gnurou@...il.com>,
	Stephen Warren <swarren@...dotorg.org>,
	linux-kernel@...r.kernel.org,
	Thierry Reding <thierry.reding@...il.com>,
	Hiroshi DOYU <hdoyu@...dia.com>
Subject: Re: [PATCH 2/3] amba: tegra-ahb: use correct base address for future
 chip support

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ