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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160804154814.GA10383@sirena.org.uk>
Date:	Thu, 4 Aug 2016 16:48:14 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Cristian Birsan <cristian.birsan@...rochip.com>
Cc:	nicolas.ferre@...el.com, ludovic.desroches@...el.com,
	alexandre.belloni@...e-electrons.com,
	boris.brezillon@...e-electrons.com, ce3a@....de,
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] regmap: Add a function to check if a regmap register
 is cached

On Thu, Aug 04, 2016 at 05:55:57PM +0300, Cristian Birsan wrote:

> +bool regmap_cached(struct regmap *map, unsigned int reg)
> +{
> +	if (map->cache == REGCACHE_NONE)
> +		return false;
> +
> +	if (!map->cache_ops)
> +		return false;
> +
> +	if (map->max_register && reg > map->max_register)
> +		return false;
> +
> +	return true;
> +}

As Lars said this isn't actually checking if the register is cached.  To
do this you need to modify the output code to check if there's a value
cached and try a read if there is one instead.

Download attachment "signature.asc" of type "application/pgp-signature" (474 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ