Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kurt Borja" <kuurtb@gmail.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v5 07/10] iio: adc: ti-ads1262: support excitation currents
Date: Sat, 10 Oct 2026 07:09:19 +0000	[thread overview]
Message-ID: <sashiko-outbox-166297@kernel.org> (raw)
In-Reply-To: <20261010-ads126x-v5-7-49e331cb2fed@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] iio: adc: ti-ads1262: Build failure in min() macro due to mixed signedness
--

commit f745e114f602a4dc9a511ee58a8c5092e66748e8
Author: Kurt Borja <kuurtb@gmail.com>

iio: adc: ti-ads1262: support excitation currents

This commit adds support for the two IDAC excitation current sources on the
TI ADS1262 ADC. It allows routing IDAC outputs to pins and configuring their
magnitudes via device tree properties.

> diff --git a/drivers/iio/adc/ti-ads1262.c b/drivers/iio/adc/ti-ads1262.c
> index 938e260753027..49d4bf206be07 100644
> --- a/drivers/iio/adc/ti-ads1262.c
> +++ b/drivers/iio/adc/ti-ads1262.c

[ ... ]

> @@ -1332,7 +1372,51 @@ static int ads1262_parse_channel_node(struct ads1262 *st,

[ ... ]

> +	if (fwnode_property_present(node, "excitation-channels")) {
> +		count = fwnode_property_count_u32(node, "excitation-channels");
> +		if (count < 0)
> +			return dev_err_probe(dev, count,
> +					     "%pfwP: failed to count excitation-channels\n", node);
> +
> +		pins[0] = ADS1262_IDACMUX_NO_CONN;
> +		pins[1] = ADS1262_IDACMUX_NO_CONN;
> +		ret = fwnode_property_read_u32_array(node, "excitation-channels",
> +						     pins, min(count, ARRAY_SIZE(pins)));

[Severity: Low]
Does this introduce a compile-time regression due to strict signed/unsigned
type checking in the min() macro?

The fwnode_property_count_u32() function returns a signed int which is
stored in the count variable, while ARRAY_SIZE() evaluates to an unsigned
size_t. The kernel's min() macro enforces that both arguments have
compatible signedness, which triggers a build-breaking assertion here.

Could min_t(size_t, count, ARRAY_SIZE(pins)) or similar be used here
instead?

> +		if (ret)
> +			return dev_err_probe(dev, ret,
> +					     "%pfwP: failed to read excitation-channels\n", node);

[ ... ]

> +		mags[0] = 0;
> +		mags[1] = 0;
> +		ret = fwnode_property_read_u32_array(node, "excitation-current-nanoamp",
> +						     mags, min(count, ARRAY_SIZE(mags)));

[Severity: Low]
Does this also trigger the same min() macro signedness build regression as
above, since count is signed and ARRAY_SIZE(mags) is unsigned?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261010-ads126x-v5-0-49e331cb2fed@gmail.com?part=7

  reply	other threads:[~2026-10-10  7:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10  6:52 [PATCH v5 00/10] iio: adc: Add TI ADS126X ADC family support Kurt Borja
2026-10-10  6:52 ` [PATCH v5 01/10] dt-bindings: adc: add excitation-current-chopping property Kurt Borja
2026-10-10  6:52 ` [PATCH v5 02/10] dt-bindings: iio: adc: support the TI ADS126x ADC family Kurt Borja
2026-10-10  7:02   ` sashiko-bot
2026-10-10  6:52 ` [PATCH v5 03/10] iio: adc: add the ti-ads1262 driver Kurt Borja
2026-10-10  7:05   ` sashiko-bot
2026-10-10  6:52 ` [PATCH v5 04/10] iio: adc: ti-ads1262: support per-channel sampling frequency Kurt Borja
2026-10-10  7:07   ` sashiko-bot
2026-10-10  6:52 ` [PATCH v5 05/10] iio: adc: ti-ads1262: support per-channel reference and gain Kurt Borja
2026-10-10  6:52 ` [PATCH v5 06/10] iio: adc: ti-ads1262: support input chopping Kurt Borja
2026-10-10  6:52 ` [PATCH v5 07/10] iio: adc: ti-ads1262: support excitation currents Kurt Borja
2026-10-10  7:09   ` sashiko-bot [this message]
2026-10-10  6:52 ` [PATCH v5 08/10] iio: adc: ti-ads1262: support triggered buffer sampling Kurt Borja
2026-10-10  7:09   ` sashiko-bot
2026-10-10  6:52 ` [PATCH v5 09/10] iio: adc: ti-ads1262: support REFOUT and VBIAS regulators Kurt Borja
2026-10-10  6:52 ` [PATCH v5 10/10] iio: adc: ti-ads1262: support common mode supplies Kurt Borja

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=sashiko-outbox-166297@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kuurtb@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.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