mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ti-ads1262: use umin() for excitation array lengths
@ 2026-11-08 22:55 Kurt Borja
  2026-11-09  9:35 ` Joshua Crofts
  0 siblings, 1 reply; 2+ messages in thread
From: Kurt Borja @ 2026-11-08 22:55 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner
  Cc: Nuno Sá,
	Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel,
	kernel test robot, Kurt Borja

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@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610241549.J9R32Wf7-lkp@intel.com/
Closes: https://lore.kernel.org/oe-kbuild-all/202611080814.7RmHoQ6e-lkp@intel.com/
Fixes: b0b43a26dfc9 ("iio: adc: ti-ads1262: support excitation currents")
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: adc: ti-ads1262: use umin() for excitation array lengths
  2026-11-08 22:55 [PATCH] iio: adc: ti-ads1262: use umin() for excitation array lengths Kurt Borja
@ 2026-11-09  9:35 ` Joshua Crofts
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Crofts @ 2026-11-09  9:35 UTC (permalink / raw)
  To: Kurt Borja
  Cc: Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel,
	kernel test robot

On Sun, 08 Nov 2026 19:55:51 -0300
Kurt Borja <kuurtb@gmail.com> wrote:

> 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@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610241549.J9R32Wf7-lkp@intel.com/
> Closes: https://lore.kernel.org/oe-kbuild-all/202611080814.7RmHoQ6e-lkp@intel.com/
> Fixes: b0b43a26dfc9 ("iio: adc: ti-ads1262: support excitation currents")
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---

Reviewed-by: Joshua Crofts <crofts@kernel.org>

-- 
Kind regards,
Joshua Crofts

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-09  9:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-08 22:55 [PATCH] iio: adc: ti-ads1262: use umin() for excitation array lengths Kurt Borja
2026-11-09  9:35 ` Joshua Crofts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®