From: Jonathan Cameron <jic23@kernel.org>
To: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Cc: linux-iio@vger.kernel.org,
Marcelo Schmitt <marcelo.schmitt@analog.com>,
conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 5/6] iio: adc: ltc2378: Add support for LTC2338-18
Date: Sat, 1 Aug 2026 22:12:36 +0100 [thread overview]
Message-ID: <20260801221236.6c07fa49@jic23-huawei> (raw)
In-Reply-To: <amiqwmIHsgO7v8zC@debian-BULLSEYE-live-builder-AMD64>
On Tue, 28 Jul 2026 10:12:34 -0300
Marcelo Schmitt <marcelo.schmitt1@gmail.com> wrote:
> On 07/27, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Low] Declaring a variable immediately after a switch case label without a block statement causes a compilation error.
> > --
> >
> > --- Patch [5]: [PATCH v9 5/6] iio: adc: ltc2378: Add support for LTC2338-18 ---
> > commit 29728b1d34f34b2970657e2d83536de22940ee2e
> > Author: Marcelo Schmitt <marcelo.schmitt@analog.com>
> >
> > iio: adc: ltc2378: Add support for LTC2338-18
> >
> > This commit adds support for the LTC2338-18 ADC to the existing ltc2378
> > driver. It extends the driver to handle the internal voltage reference and
> > input signal attenuation specific to this part.
> >
> > > diff --git a/drivers/iio/adc/ltc2378.c b/drivers/iio/adc/ltc2378.c
> > > --- a/drivers/iio/adc/ltc2378.c
> > > +++ b/drivers/iio/adc/ltc2378.c
> >
> > [ ... ]
> >
> > > @@ -383,7 +395,10 @@ static int ltc2378_read_raw(struct iio_dev *indio_dev,
> > > return IIO_VAL_INT;
> > > }
> > > case IIO_CHAN_INFO_SCALE:
> > > + struct u32_fract fract = st->info->internal_div;
> >
> > [Severity: Low]
> > Does this declaration cause a build error?
> No, at least not when I built with clang/llvm-22.
Maybe but given we still stick to declarations at top of scope (if not
strictly required) makes me want add scope here anyway.
So I tweaked it to add the {}
Series applied to the testing branch of iio.git.
Thanks,
Jonathan
>
> > Declaring a variable immediately
> > after a switch case label without a block statement is not a valid statement
> > in C and usually causes a compiler error. Could this case be wrapped in a
> > block to scope the variable, or the declaration be moved to the top of the
> > function?
> >
> > > *val = st->ref_uV / MILLI;
> > > + if (fract.numerator && fract.denominator)
> > > + *val = mult_frac(*val, fract.numerator, fract.denominator);
> > > /*
> > > * For all LTC2378-like devices, the amount of bits that express
> > > * voltage magnitude depend on the polarity / output code format:
> >
> > --
> > Sashiko AI review · https://sashiko.dev/#/patchset/cover.1785186980.git.marcelo.schmitt@analog.com?part=5
>
next prev parent reply other threads:[~2026-08-01 21:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 21:30 [PATCH v9 0/6] iio: adc: Add support for LTC2378 and similar ADCs Marcelo Schmitt
2026-07-27 21:30 ` [PATCH v9 1/6] dt-bindings: iio: adc: Add ltc2378 Marcelo Schmitt
2026-07-27 21:30 ` [PATCH v9 2/6] iio: adc: ltc2378: Add support for LTC2378-20 and similar ADCs Marcelo Schmitt
[not found] ` <20260727214213.D377F1F000E9@smtp.kernel.org>
2026-07-28 13:06 ` Marcelo Schmitt
2026-07-27 21:31 ` [PATCH v9 3/6] iio: adc: ltc2378: Enable high-speed data capture Marcelo Schmitt
2026-07-27 21:31 ` [PATCH v9 4/6] iio: adc: ltc2378: Enable triggered buffer " Marcelo Schmitt
2026-07-27 21:31 ` [PATCH v9 5/6] iio: adc: ltc2378: Add support for LTC2338-18 Marcelo Schmitt
[not found] ` <20260727214022.C81191F000E9@smtp.kernel.org>
2026-07-28 13:12 ` Marcelo Schmitt
2026-08-01 21:12 ` Jonathan Cameron [this message]
2026-07-27 21:32 ` [PATCH v9 6/6] iio: ABI: Encourage differential voltage ABI usage Marcelo Schmitt
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=20260801221236.6c07fa49@jic23-huawei \
--to=jic23@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=marcelo.schmitt1@gmail.com \
--cc=marcelo.schmitt@analog.com \
--cc=robh@kernel.org \
/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