[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250208154521.193da461@jic23-huawei>
Date: Sat, 8 Feb 2025 15:45:21 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Angelo Dureghello <adureghello@...libre.com>
Cc: Lars-Peter Clausen <lars@...afoo.de>, Michael Hennerich
<Michael.Hennerich@...log.com>, Nuno Sa <nuno.sa@...log.com>, Jonathan
Cameron <Jonathan.Cameron@...wei.com>, linux-iio@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: dac: adi-axi-dac: drop io_mode check
On Thu, 06 Feb 2025 09:36:14 +0100
Angelo Dureghello <adureghello@...libre.com> wrote:
> From: Angelo Dureghello <adureghello@...libre.com>
>
> Drop mode check, producing the following robot test warning:
>
> smatch warnings:
> drivers/iio/dac/adi-axi-dac.c:731 axi_dac_bus_set_io_mode()
> warn: always true condition '(mode >= 0) => (0-u32max >= 0)'
>
> The range check results not useful since these are the only
> plausible modes for enum ad3552r_io_mode.
>
> Fixes: 493122c53af1 ("iio: dac: adi-axi-dac: add bus mode setup")
> Signed-off-by: Angelo Dureghello <adureghello@...libre.com>
Ah. I missed this. Anyhow made the same change directly so all is well
than ends well!
Thanks,
Jonathan
> ---
> drivers/iio/dac/adi-axi-dac.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/drivers/iio/dac/adi-axi-dac.c b/drivers/iio/dac/adi-axi-dac.c
> index ac4c96c4ccf3..bcaf365feef4 100644
> --- a/drivers/iio/dac/adi-axi-dac.c
> +++ b/drivers/iio/dac/adi-axi-dac.c
> @@ -728,9 +728,6 @@ static int axi_dac_bus_set_io_mode(struct iio_backend *back,
> struct axi_dac_state *st = iio_backend_get_priv(back);
> int ival, ret;
>
> - if (!(mode >= AD3552R_IO_MODE_SPI && mode <= AD3552R_IO_MODE_QSPI))
> - return -EINVAL;
> -
> guard(mutex)(&st->lock);
>
> ret = regmap_update_bits(st->regmap, AXI_DAC_CUSTOM_CTRL_REG,
>
> ---
> base-commit: c667ed738d7d1a01e9b946ef47cae113b0a05bee
> change-id: 20250206-wip-bl-ad3552r-axi-v0-iio-testing-carlos-070ecab6a52a
>
> Best regards,
Powered by blists - more mailing lists