Linux IIO development
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Yury Norov" <yury.norov@gmail.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ad7606_spi: use bitmap_full() in ad7606_spi_update_scan_mode()
Date: Mon, 15 Dec 2025 18:26:46 -0600	[thread overview]
Message-ID: <e1284b0c-3ad5-4c54-aa58-30f416aa98f8@baylibre.com> (raw)
In-Reply-To: <aUCmZk0S_tq3SOOY@yury>

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@gmail.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@baylibre.com>


  reply	other threads:[~2025-12-16  0:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-16  0:18 [PATCH] iio: adc: ad7606_spi: use bitmap_full() in ad7606_spi_update_scan_mode() Yury Norov (NVIDIA)
2025-12-16  0:23 ` Yury Norov
2025-12-16  0:26   ` David Lechner [this message]
2025-12-21 19:48     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e1284b0c-3ad5-4c54-aa58-30f416aa98f8@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox