Re: [PATCH] iio: pressure: abp2030pa: Remove unreachable return in abp2_read_raw()
From: Siratul Islam
Date: Sun Jul 26 2026 - 05:43:27 EST
On Sun, 2026-07-26 at 07:22 +0000, Babanpreet Singh wrote:
> 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 <bbnpreetsingh@xxxxxxxxx>
> ---
>
LGTM.
Reviewed-by: Siratul Islam <siratul.islam@xxxxxxxxx>
--
Best regards,
Sirat