Re: [PATCH] iio: pressure: abp2030pa: Remove unreachable return in abp2_read_raw()

Siratul Islam <[email protected]>
Newsgroups org.kernel.vger.linux-iio,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
> ---
> 
LGTM.

Reviewed-by: Siratul Islam <[email protected]>

--
Best regards,
Sirat
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.