LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Andrea Merello <andrea.merello@gmail.com>
Cc: Yury Norov <yury.norov@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Andrea Merello <andrea.merello@iit.it>
Subject: Re: [PATCH v1 1/1] bitmap.h: add const modifier to bitmap_next_[set/clear]_region() argument
Date: Wed, 28 Jul 2021 12:18:46 +0300	[thread overview]
Message-ID: <CAHp75VdL9du5QRvi9Jz7kjPDrNwqCtH8-1qXsVbKD_BuKM01uA@mail.gmail.com> (raw)
In-Reply-To: <CAN8YU5PD9i=qztMLyuFsMQFf80pz04dLOSQ0NJ9=uHb1bTh52w@mail.gmail.com>

On Wed, Jul 28, 2021 at 9:39 AM Andrea Merello <andrea.merello@gmail.com> wrote:
> Il giorno mar 27 lug 2021 alle ore 17:26 Yury Norov
> <yury.norov@gmail.com> ha scritto:
> > On Tue, Jul 27, 2021 at 02:48:42PM +0300, Andy Shevchenko wrote:

...

> > I try to remove those two because in practice they bring more mess
> > than good. All real use-cases for bitmap_next_{set,clear}_region
> > relate to iterating the whole bitmap, ie nobody just wants to find a
> > next region. Untill recently there was only a single user of the API,
> > so I easily reworked the code to use find_first_bit/find_next bit and
> > by chance return faster.
>
> Ah, that's interesting to know: I'm working on a new driver that used
> find_next_zero_bit() and find_next_bit() [0]; Andy told me that my
> algorithm could be rewritten exploiting some bitmap_* helpers, so I
> rewrote my code using bitmap_for_each_set_region(), which in turn uses
> bitmap_next_set_region().
>
> Should I revert to my previous implementation that uses
> find_next_zero_bit() and find_next_bit() ?

According to the

https://github.com/norov/linux/commit/a2d6e02d19450a49a55f08c151d1f704723bec1a

they are transformed to for_each_bitrange(), etc.

...

> Looks like also bitmap_for_each_set_region() went away indeed ?

See above.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-07-28  9:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  9:44 Andrea Merello
2021-07-27 11:48 ` Andy Shevchenko
2021-07-27 15:26   ` Yury Norov
2021-07-28  6:39     ` Andrea Merello
2021-07-28  9:18       ` Andy Shevchenko [this message]
2021-07-28 13:46       ` Yury Norov

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=CAHp75VdL9du5QRvi9Jz7kjPDrNwqCtH8-1qXsVbKD_BuKM01uA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andrea.merello@gmail.com \
    --cc=andrea.merello@iit.it \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=yury.norov@gmail.com \
    --subject='Re: [PATCH v1 1/1] bitmap.h: add const modifier to bitmap_next_[set/clear]_region() argument' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).