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: <20250515181344.504143ff@jic23-huawei>
Date: Thu, 15 May 2025 18:13:44 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Alexandru Soponar <asoponar@...adin.ro>
Cc: linux-kernel@...r.kernel.org, linux-hwmon@...r.kernel.org,
 linux-iio@...r.kernel.org, linux-leds@...r.kernel.org,
 linux-watchdog@...r.kernel.org, jdelvare@...e.com, linux@...ck-us.net,
 pavel@....cz, lee@...nel.org, baocheng.su@...mens.com,
 wim@...ux-watchdog.org, tobias.schaffner@...mens.com,
 angelogioacchino.delregno@...labora.com, benedikt.niedermayr@...mens.com,
 matthias.bgg@...il.com, aardelean@...libre.com, contact@...y.one
Subject: Re: [PATCH 10/16] iio: ad7606: Fix type incompatibility with
 non-macro find_closest

On Thu, 15 May 2025 11:13:26 +0300
Alexandru Soponar <asoponar@...adin.ro> wrote:

> The ad7606_oversampling_avail and ad7616_oversampling_avail arrays were
> previously declared as unsigned int but used with find_closest(). With
> find_closest() now implemented as a function taking signed int parameters
> instead of a macro, passing unsigned arrays causes type incompatibility
> errors. This patch changes the arrays type from unsigned int to int to
> ensure compatibility with the function signature and prevent compilation
> errors.
> 
> Signed-off-by: Alexandru Soponar <asoponar@...adin.ro>
Assuming overall approach is fine, this change is fine wrt to ranges
etc.

Acked-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>

> ---
>  drivers/iio/adc/ad7606.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
> index d8e3c7a43678..41b477ea386d 100644
> --- a/drivers/iio/adc/ad7606.c
> +++ b/drivers/iio/adc/ad7606.c
> @@ -81,11 +81,11 @@ static const unsigned int ad7609_hw_scale_avail[2][2] = {
>  	{ 0, 152588 }, { 0, 305176 }
>  };
>  
> -static const unsigned int ad7606_oversampling_avail[7] = {
> +static const int ad7606_oversampling_avail[7] = {
>  	1, 2, 4, 8, 16, 32, 64,
>  };
>  
> -static const unsigned int ad7616_oversampling_avail[8] = {
> +static const int ad7616_oversampling_avail[8] = {
>  	1, 2, 4, 8, 16, 32, 64, 128,
>  };
>  
> @@ -835,7 +835,7 @@ static int ad7606_write_raw(struct iio_dev *indio_dev,
>  			    long mask)
>  {
>  	struct ad7606_state *st = iio_priv(indio_dev);
> -	unsigned int scale_avail_uv[AD760X_MAX_SCALES];
> +	int scale_avail_uv[AD760X_MAX_SCALES];
>  	struct ad7606_chan_scale *cs;
>  	int i, ret, ch = 0;
>  
> @@ -884,7 +884,7 @@ static ssize_t ad7606_oversampling_ratio_avail(struct device *dev,
>  {
>  	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>  	struct ad7606_state *st = iio_priv(indio_dev);
> -	const unsigned int *vals = st->oversampling_avail;
> +	const int *vals = st->oversampling_avail;
>  	unsigned int i;
>  	size_t len = 0;
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ