Re: [PATCH] staging: iio: ad5933: Fix implicit fall-through in switch()
From: Greg KH
Date: Mon Jul 28 2025 - 06:39:43 EST
On Mon, Jul 28, 2025 at 03:29:28PM +0530, Akhilesh Patil wrote:
> Add default case in switch() codeblock in ad5933_read_raw().
> Convert implicit error return due to switch fallthrough to explicit return
> to make intent clear. Follow kernel switch fall-thorugh guidelines at
> Documentation/process/deprecated.rst
>
> Signed-off-by: Akhilesh Patil <akhilesh@xxxxxxxxxxxxx>
> ---
> Checked build for 6.16.0 kernel with ad5933
> ---
> drivers/staging/iio/impedance-analyzer/ad5933.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c b/drivers/staging/iio/impedance-analyzer/ad5933.c
> index 85a4223295cd..6547a259b8a0 100644
> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c
> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
> @@ -533,9 +533,10 @@ static int ad5933_read_raw(struct iio_dev *indio_dev,
> *val = 1000;
> *val2 = 5;
> return IIO_VAL_FRACTIONAL_LOG2;
> + default:
> + return -EINVAL;
What tool is requiring this to be added? It's totally redundant and
needs to have the tool fixed instead.
sorry,
greg k-h