lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e1284b0c-3ad5-4c54-aa58-30f416aa98f8@baylibre.com>
Date: Mon, 15 Dec 2025 18:26:46 -0600
From: David Lechner <dlechner@...libre.com>
To: Yury Norov <yury.norov@...il.com>, Lars-Peter Clausen <lars@...afoo.de>,
 Michael Hennerich <Michael.Hennerich@...log.com>,
 Jonathan Cameron <jic23@...nel.org>, Nuno Sá
 <nuno.sa@...log.com>, Andy Shevchenko <andy@...nel.org>,
 linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] iio: adc: ad7606_spi: use bitmap_full() in
 ad7606_spi_update_scan_mode()

On 12/15/25 6:23 PM, Yury Norov wrote:
> On Mon, Dec 15, 2025 at 07:18:06PM -0500, Yury Norov (NVIDIA) wrote:
>> bitmap_empty() is more verbose and efficient, as it stops traversing
>> scan_mask as soon as the 1st set bit found.
>  
> Ah, please read this as:
> 
> bitmap_full() is more verbose and efficient, as it stops traversing
> scan_mask as soon as the 1st unset bit found.
> 

I think you mean "bitmap_full() is less verbose"?

This isn't a hot path, so efficiency isn't important.

This makes the code easier to understand anyway, so a worthy change.


> Sorry for miswording the commit message.
> 
>> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@...il.com>
>> ---
>>  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 f28e4ca37707..7e17ccbcedd0 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.43.0

With the commit message fixed:

Reviewed-by: David Lechner <dlechner@...libre.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ