[PATCH] iio: adc: ti-ads1262: use umin() for excitation array lengths

From: Kurt Borja

Date: Sun Nov 08 2026 - 17:56:36 EST


min() rejects mixing the signed count with the unsigned ARRAY_SIZE()
unless the compiler can prove count is non-negative, which fails on
some configs and breaks the build. count is already checked to be
non-negative, so use umin().

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202610241549.J9R32Wf7-lkp@xxxxxxxxx/
Closes: https://lore.kernel.org/oe-kbuild-all/202611080814.7RmHoQ6e-lkp@xxxxxxxxx/
Fixes: b0b43a26dfc9 ("iio: adc: ti-ads1262: support excitation currents")
Signed-off-by: Kurt Borja <kuurtb@xxxxxxxxx>
---
drivers/iio/adc/ti-ads1262.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ti-ads1262.c b/drivers/iio/adc/ti-ads1262.c
index 66a7fedfefde..58a8eacc6ef5 100644
--- a/drivers/iio/adc/ti-ads1262.c
+++ b/drivers/iio/adc/ti-ads1262.c
@@ -1807,7 +1807,7 @@ static int ads1262_parse_channel_node(struct ads1262 *st,
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)));
+ pins, umin(count, ARRAY_SIZE(pins)));
if (ret)
return dev_err_probe(dev, ret,
"%pfwP: failed to read excitation-channels\n", node);
@@ -1820,7 +1820,7 @@ static int ads1262_parse_channel_node(struct ads1262 *st,
mags[0] = 0;
mags[1] = 0;
ret = fwnode_property_read_u32_array(node, "excitation-current-nanoamp",
- mags, min(count, ARRAY_SIZE(mags)));
+ mags, umin(count, ARRAY_SIZE(mags)));
if (ret)
return dev_err_probe(dev, ret,
"%pfwP: failed to read excitation-current-nanoamp\n",

---
base-commit: b70566610b48ba49dec636019da4d696db64b085
change-id: 20261108-ti-ads1262-excitation-umin-a5f9a610504f

--
Thanks,
~ Kurt