From: Siratul Islam <siratul.islam@linux.dev>
To: Babanpreet Singh <bbnpreetsingh@gmail.com>,
Jonathan Cameron <jic23@kernel.org>,
Petre Rodan <petre.rodan@subdimension.ro>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: pressure: abp2030pa: Remove unreachable return in abp2_read_raw()
Date: Sun, 26 Jul 2026 15:42:55 +0600 [thread overview]
Message-ID: <d11e5b35268c4ec044c24c22cbfd816a9072edda.camel@linux.dev> (raw)
In-Reply-To: <20260726072234.7-1-bbnpreetsingh@gmail.com>
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@gmail.com>
> ---
>
LGTM.
Reviewed-by: Siratul Islam <siratul.islam@linux.dev>
--
Best regards,
Sirat
prev parent reply other threads:[~2026-07-26 9:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 7:22 [PATCH] iio: pressure: abp2030pa: Remove unreachable return in abp2_read_raw() Babanpreet Singh
2026-07-26 9:42 ` Siratul Islam [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d11e5b35268c4ec044c24c22cbfd816a9072edda.camel@linux.dev \
--to=siratul.islam@linux.dev \
--cc=andy@kernel.org \
--cc=bbnpreetsingh@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=petre.rodan@subdimension.ro \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox