From 4e44c635ba8c281f74001d47e20bbcb7f516530c Mon Sep 17 00:00:00 2001 From: "Yury Norov (NVIDIA)" Date: Mon, 15 Dec 2025 19:18:06 -0500 Subject: [PATCH] iio: adc: ad7606_spi: use bitmap_full() in ad7606_spi_update_scan_mode() bitmap_full() is less verbose and more efficient, as it stops traversing scan_mask as soon as the 1st unset bit found. Signed-off-by: Yury Norov (NVIDIA) Reviewed-by: David Lechner Signed-off-by: Jonathan Cameron --- drivers/iio/adc/ad7606_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7606_spi.c b/drivers/iio/adc/ad7606_spi.c index f28e4ca377076..7e17ccbcedd0c 100644 --- a/drivers/iio/adc/ad7606_spi.c +++ b/drivers/iio/adc/ad7606_spi.c @@ -345,7 +345,7 @@ static int ad7606_spi_update_scan_mode(struct iio_dev *indio_dev, * has no way of demuxing the data to filter out unwanted * channels. */ - if (bitmap_weight(scan_mask, num_adc_ch) != num_adc_ch) + if (!bitmap_full(scan_mask, num_adc_ch)) return -EINVAL; } -- 2.47.3