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: <20250112113420.3b705e0b@jic23-huawei>
Date: Sun, 12 Jan 2025 11:34:20 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Julien Stephan <jstephan@...libre.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>, Michael Hennerich
 <Michael.Hennerich@...log.com>, Nuno Sá <nuno.sa@...log.com>,
 David Lechner <dlechner@...libre.com>, Jonathan Corbet <corbet@....net>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
 linux-doc@...r.kernel.org
Subject: Re: [PATCH v3 3/5] iio: adc: ad7380: do not store osr in private
 data structure

On Tue, 07 Jan 2025 09:48:27 +0100
Julien Stephan <jstephan@...libre.com> wrote:

> Since regmap cache is now enabled, we don't need to store the
> oversampling ratio in the private data structure.
> 
> Signed-off-by: Julien Stephan <jstephan@...libre.com>
I don't mind the solution you have here, but one passing comment inline.
Up to you on whether you take any notice!


> +static int ad7380_get_osr(struct ad7380_state *st, int *val)
> +{
> +	u32 tmp;
> +	int ret;
> +
> +	ret = regmap_read(st->regmap, AD7380_REG_ADDR_CONFIG1, &tmp);
> +	if (ret)
> +		return ret;
> +
> +	*val = ad7380_regval_to_osr(FIELD_GET(AD7380_CONFIG1_OSR, tmp));

All small values, so maybe cleaner to just return this instead
of using a parameter.

> +
> +	return 0;
> +}



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ