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: <20251221183455.3dd15dd7@jic23-huawei>
Date: Sun, 21 Dec 2025 18:34:55 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Petre Rodan <petre.rodan@...dimension.ro>
Cc: David Lechner <dlechner@...libre.com>, Nuno Sá
 <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>, Andreas Klinger
 <ak@...klinger.de>, linux-iio@...r.kernel.org,
 linux-kernel@...r.kernel.org, Jonathan Cameron
 <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH 11/14] iio: pressure: mprls0025pa: fix scan_type struct

On Thu, 18 Dec 2025 13:05:53 +0200
Petre Rodan <petre.rodan@...dimension.ro> wrote:

> Fix the scan_type sign and realbits assignment.
> 
> The pressure is a 24bit unsigned int between output_min and output_max.
> 
>  transfer function A: 10%   to 90%   of 2^24
>  transfer function B:  2.5% to 22.5% of 2^24

Hmm. So, that's not ever going to use all the bits. It fits in 22 bits?

>  transfer function C: 20%   to 80%   of 2^24
> [MPR_FUNCTION_A] = { .output_min = 1677722, .output_max = 15099494 }
> [MPR_FUNCTION_B] = { .output_min =  419430, .output_max =  3774874 }
> [MPR_FUNCTION_C] = { .output_min = 3355443, .output_max = 13421773 }
> 
> Fixes: 713337d9143e ("iio: pressure: Honeywell mprls0025pa pressure sensor")
> Signed-off-by: Petre Rodan <petre.rodan@...dimension.ro>

Where possible drag any fixes as early as possible in the series as they
are more likely to be backported.

Here, I think the impact is constrained to the expected limits userspace
might work out rather than how the actual value of pressure is interpreted?
If so, good to fix but fairly minor bug.

Jonathan

> ---
>  drivers/iio/pressure/mprls0025pa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/pressure/mprls0025pa.c b/drivers/iio/pressure/mprls0025pa.c
> index 9b18d5fb7e42..243a5717b88f 100644
> --- a/drivers/iio/pressure/mprls0025pa.c
> +++ b/drivers/iio/pressure/mprls0025pa.c
> @@ -165,8 +165,8 @@ static const struct iio_chan_spec mpr_channels[] = {
>  					BIT(IIO_CHAN_INFO_OFFSET),
>  		.scan_index = 0,
>  		.scan_type = {
> -			.sign = 's',
> -			.realbits = 32,
> +			.sign = 'u',
> +			.realbits = 24,
>  			.storagebits = 32,
>  			.endianness = IIO_CPU,
>  		},
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ