Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Soponar <asoponar@taladin.ro>
Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-iio@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-watchdog@vger.kernel.org, jdelvare@suse.com,
	linux@roeck-us.net, pavel@ucw.cz, lee@kernel.org,
	baocheng.su@siemens.com, wim@linux-watchdog.org,
	tobias.schaffner@siemens.com,
	angelogioacchino.delregno@collabora.com,
	benedikt.niedermayr@siemens.com, matthias.bgg@gmail.com,
	aardelean@baylibre.com, contact@sopy.one
Subject: Re: [PATCH 10/16] iio: ad7606: Fix type incompatibility with non-macro find_closest
Date: Thu, 15 May 2025 18:13:44 +0100	[thread overview]
Message-ID: <20250515181344.504143ff@jic23-huawei> (raw)
In-Reply-To: <20250515081332.151250-11-asoponar@taladin.ro>

On Thu, 15 May 2025 11:13:26 +0300
Alexandru Soponar <asoponar@taladin.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@taladin.ro>
Assuming overall approach is fine, this change is fine wrt to ranges
etc.

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.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;
>  


  reply	other threads:[~2025-05-15 17:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15  8:13 [PATCH 0/16] lib: Refactor find_closest() and find_closest_descending() from macros to lib functions Alexandru Soponar
2025-05-15  8:13 ` [PATCH 01/16] hwmon: w83795: Fix type incompatibility with non-macro find_closest Alexandru Soponar
2025-05-15  8:13 ` [PATCH 02/16] hwmon: emc1403: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 03/16] hwmon: ina3221: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 04/16] hwmon: lm95234: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 05/16] hwmon: max1619: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 06/16] hwmon: lm75: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 07/16] hwmon: ltc4282: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 08/16] hwmon: max6639: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 09/16] hwmon: max20740: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 10/16] iio: ad7606: " Alexandru Soponar
2025-05-15 17:13   ` Jonathan Cameron [this message]
2025-05-15  8:13 ` [PATCH 11/16] iio: mcp3564: " Alexandru Soponar
2025-05-15 17:14   ` Jonathan Cameron
2025-05-19  8:09   ` Marius.Cristea
2025-05-15  8:13 ` [PATCH 12/16] iio: max44009: " Alexandru Soponar
2025-05-15 17:14   ` Jonathan Cameron
2025-05-15  8:13 ` [PATCH 13/16] leds: eds-mt6370-rgb: Fix type incompatibility with find_closest() Alexandru Soponar
2025-05-22 14:33   ` Lee Jones
2025-05-15  8:13 ` [PATCH 14/16] regulator: max77857: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 15/16] watchdog: simatic-ipc-wdt: " Alexandru Soponar
2025-05-15  8:13 ` [PATCH 16/16] lib: move find_closest() and find_closest_descending() to lib functions Alexandru Soponar
2025-05-19 16:35   ` David Lechner
2025-05-19 15:44 ` [PATCH 0/16] lib: Refactor find_closest() and find_closest_descending() from macros " Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250515181344.504143ff@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=aardelean@baylibre.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=asoponar@taladin.ro \
    --cc=baocheng.su@siemens.com \
    --cc=benedikt.niedermayr@siemens.com \
    --cc=contact@sopy.one \
    --cc=jdelvare@suse.com \
    --cc=lee@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=matthias.bgg@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=tobias.schaffner@siemens.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox