Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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) <yury.norov@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Yury Norov (NVIDIA) and committed by
Jonathan Cameron
4e44c635 eec44b04

+1 -1
+1 -1
drivers/iio/adc/ad7606_spi.c
··· 345 345 * has no way of demuxing the data to filter out unwanted 346 346 * channels. 347 347 */ 348 - if (bitmap_weight(scan_mask, num_adc_ch) != num_adc_ch) 348 + if (!bitmap_full(scan_mask, num_adc_ch)) 349 349 return -EINVAL; 350 350 } 351 351