[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220514165309.7445c767@jic23-huawei>
Date: Sat, 14 May 2022 16:53:09 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Yury Norov <yury.norov@...il.com>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
David Laight <David.Laight@...LAB.COM>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Joe Perches <joe@...ches.com>,
Julia Lawall <Julia.Lawall@...ia.fr>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Nicholas Piggin <npiggin@...il.com>,
Nicolas Palix <nicolas.palix@...g.fr>,
Peter Zijlstra <peterz@...radead.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Matti Vaittinen <Matti.Vaittinen@...rohmeurope.com>,
linux-kernel@...r.kernel.org, Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
linux-iio@...r.kernel.org
Subject: Re: [PATCH 05/22] iio: replace bitmap_weight with
bitmap_weitght_{eq,le} where appropriate
On Tue, 10 May 2022 08:47:33 -0700
Yury Norov <yury.norov@...il.com> wrote:
> bitmap_weight_{eq,le} is better than bitmap_weight because it
> may return earlier.
>
> CC: Jonathan Cameron <jic23@...nel.org>
> CC: Lars-Peter Clausen <lars@...afoo.de>
> CC: Michael Hennerich <Michael.Hennerich@...log.com>
> CC: linux-iio@...r.kernel.org
> CC: linux-kernel@...r.kernel.org
> Signed-off-by: Yury Norov <yury.norov@...il.com>
without being cc'd on the cover letter, there is no obvious way for
me to know this is reliant in some series to be found in next.
Please call out the exact dependency and whilst it's a long list,
it is good to cc all people cc'd on individual patches also
on the cover letter so they have that background information.
Change seems fine, but I've no idea when/if to pick it up because of
that lack of information.
Jonathan
> ---
> drivers/iio/adc/ad_sigma_delta.c | 2 +-
> drivers/iio/industrialio-buffer.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_delta.c
> index 261a9a6b45e1..6445b591f071 100644
> --- a/drivers/iio/adc/ad_sigma_delta.c
> +++ b/drivers/iio/adc/ad_sigma_delta.c
> @@ -525,7 +525,7 @@ static bool ad_sd_validate_scan_mask(struct iio_dev *indio_dev, const unsigned l
> {
> struct ad_sigma_delta *sigma_delta = iio_device_get_drvdata(indio_dev);
>
> - return bitmap_weight(mask, indio_dev->masklength) <= sigma_delta->num_slots;
> + return bitmap_weight_le(mask, indio_dev->masklength, sigma_delta->num_slots);
> }
>
> static const struct iio_buffer_setup_ops ad_sd_buffer_setup_ops = {
> diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
> index 06141ca27e1f..18d3d756aee1 100644
> --- a/drivers/iio/industrialio-buffer.c
> +++ b/drivers/iio/industrialio-buffer.c
> @@ -1824,7 +1824,7 @@ void iio_buffers_free_sysfs_and_mask(struct iio_dev *indio_dev)
> bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
> const unsigned long *mask)
> {
> - return bitmap_weight(mask, indio_dev->masklength) == 1;
> + return bitmap_weight_eq(mask, indio_dev->masklength, 1);
> }
> EXPORT_SYMBOL_GPL(iio_validate_scan_mask_onehot);
>
Powered by blists - more mailing lists