[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190327123059.GI9224@smile.fi.intel.com>
Date: Wed, 27 Mar 2019 14:30:59 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: William Breathitt Gray <vilhelm.gray@...il.com>
Cc: linus.walleij@...aro.org, bgolaszewski@...libre.com,
akpm@...ux-foundation.org, linux-gpio@...r.kernel.org,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
linux@...musvillemoes.dk, yamada.masahiro@...ionext.com,
linux-arm-kernel@...ts.infradead.org, linux-pm@...r.kernel.org,
geert@...ux-m68k.org, preid@...ctromag.com.au,
Lukas Wunner <lukas@...ner.de>, Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH v13 01/11] bitops: Introduce the for_each_set_clump8 macro
On Wed, Mar 27, 2019 at 01:58:45PM +0900, William Breathitt Gray wrote:
> This macro iterates for each 8-bit group of bits (clump) with set bits,
> within a bitmap memory region. For each iteration, "start" is set to the
> bit offset of the found clump, while the respective clump value is
> stored to the location pointed by "clump". Additionally, the
> bitmap_get_value8 and bitmap_set_value8 functions are introduced to
> respectively get and set an 8-bit value in a bitmap memory region.
> +unsigned long bitmap_get_value8(const unsigned long *addr, unsigned long start)
> +{
> + const size_t idx = BIT_WORD(start);
> + const unsigned long offset = start % BITS_PER_LONG;
> +
> + return (addr[idx] >> offset) & 0xFF;
I would spell index instead of idx, but it's minor and up to you.
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists