From: Jonathan Cameron <jic23@kernel.org>
To: Siratul Islam <siratul.islam@linux.dev>
Cc: "Babanpreet Singh" <bbnpreetsingh@gmail.com>,
"Petre Rodan" <petre.rodan@subdimension.ro>,
"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: Mon, 27 Jul 2026 03:18:32 +0100 [thread overview]
Message-ID: <20260727031832.484af15f@jic23-huawei> (raw)
In-Reply-To: <d11e5b35268c4ec044c24c22cbfd816a9072edda.camel@linux.dev>
On Sun, 26 Jul 2026 15:42:55 +0600
Siratul Islam <siratul.islam@linux.dev> wrote:
> 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.
A bit too much detail. Just saying they all already returned is fine;
we don't need to know what was returned.
> >
> > 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.
Sensible check to perform but no need to state it in the patch description.
I tweaked the description whilst applying.
Applied to the testing branch of iio.git on git.kernel.org
Thanks
Jonathan
> >
> > 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-27 2:18 UTC|newest]
Thread overview: 3+ 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
2026-07-27 2:18 ` Jonathan Cameron [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=20260727031832.484af15f@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=bbnpreetsingh@gmail.com \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=petre.rodan@subdimension.ro \
--cc=siratul.islam@linux.dev \
/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