[PATCH] iio: pressure: abp2030pa: Remove unreachable return in abp2_read_raw()
Babanpreet Singh <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
In the IIO_CHAN_INFO_RAW case every arm of the inner switch on channel->type returns - IIO_PRESSURE and IIO_TEMP return IIO_VAL_INT and default returns -EINVAL - so the "return IIO_VAL_INT;" following that switch cannot be reached. The sibling IIO_CHAN_INFO_SCALE and IIO_CHAN_INFO_OFFSET cases have the same shape and no trailing return, so drop it here as well. Found by smatch: drivers/iio/pressure/abp2030pa.c:382 abp2_read_raw() warn: ignoring unreachable code. No functional change: the compiler already discarded the statement, and the generated object code is identical before and after. Assisted-by: Claude:claude-opus-5 Signed-off-by: Babanpreet Singh <[email protected]> --- drivers/iio/pressure/abp2030pa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/pressure/abp2030pa.c b/drivers/iio/pressure/abp2030pa.c index b44f1bf4c633..41395036e9ad 100644 --- a/drivers/iio/pressure/abp2030pa.c +++ b/drivers/iio/pressure/abp2030pa.c @@ -379,7 +379,6 @@ static int abp2_read_raw(struct iio_dev *indio_dev, default: return -EINVAL; } - return IIO_VAL_INT; case IIO_CHAN_INFO_SCALE: switch (channel->type) { -- 2.43.0