On Fri, 2018-06-22 at 11:46 -0700, Dmitry Torokhov wrote:
> On Thu, Jun 21, 2018 at 05:13:39AM +0300, Andy Shevchenko wrote:
> > On Tue, Jun 19, 2018 at 2:10 AM, Andrew Morton
> > wrote:
> > > On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov > > v...@gmail.com> wrote:
> > > > We can't as we end
On Thu, Jun 21, 2018 at 05:13:39AM +0300, Andy Shevchenko wrote:
> On Tue, Jun 19, 2018 at 2:10 AM, Andrew Morton
> wrote:
> > On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov
> > wrote:
>
> >> We can't as we end up including bitmap.h (by the way of cpumask.h)
> >> form slab.h, so we gen circ
On Tue, Jun 19, 2018 at 2:10 AM, Andrew Morton
wrote:
> On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov
> wrote:
>> We can't as we end up including bitmap.h (by the way of cpumask.h)
>> form slab.h, so we gen circular dependency.
>
It's not just so easy. See below.
> That info should have
A lot of code become ugly because of open coding allocations for bitmaps.
Introduce three helpers to allow users be more clear of intention
and keep their code neat.
Signed-off-by: Andy Shevchenko
---
include/linux/bitmap.h | 8
lib/bitmap.c | 19 +++
2 files
On Mon, Jun 18, 2018 at 2:14 PM Andrew Morton wrote:
>
> On Mon, 18 Jun 2018 16:10:01 +0300 Andy Shevchenko
> wrote:
>
> > A lot of code become ugly because of open coding allocations for bitmaps.
> >
> > Introduce three helpers to allow users be more clear of intention
> > and keep their code n
On Tue, Jun 19, 2018 at 2:10 AM, Andrew Morton
wrote:
> On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov
> wrote:
>
>> > > +unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags)
>> > > +{
>> > > + return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long),
>> > > flags);
>> >
On Tue, Jun 19, 2018 at 1:01 AM, Dmitry Torokhov
wrote:
> On Mon, Jun 18, 2018 at 2:14 PM Andrew Morton
> wrote:
>>
>> On Mon, 18 Jun 2018 16:10:01 +0300 Andy Shevchenko
>> wrote:
>>
>> > A lot of code become ugly because of open coding allocations for bitmaps.
>> >
>> > Introduce three helper
On Mon, 18 Jun 2018 15:01:43 -0700 Dmitry Torokhov
wrote:
> > > +unsigned long *bitmap_alloc(unsigned int nbits, gfp_t flags)
> > > +{
> > > + return kmalloc_array(BITS_TO_LONGS(nbits), sizeof(unsigned long),
> > > flags);
> > > +}
> > > +EXPORT_SYMBOL(bitmap_alloc);
> > > +
> > > +unsigned
On Mon, 18 Jun 2018 16:10:01 +0300 Andy Shevchenko
wrote:
> A lot of code become ugly because of open coding allocations for bitmaps.
>
> Introduce three helpers to allow users be more clear of intention
> and keep their code neat.
>
> ...
>
> +unsigned long *bitmap_alloc(unsigned int nbits, g