lkml.org 
[lkml]   [2021]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] xen-blkfront: Use the bitmap API when applicable
From

On 12/4/21 1:57 AM, Christophe JAILLET wrote:
>
> So, maybe adding an "official" 'bitmap_size()' (which is already existing and duplicated in a few places) would ease things.
>
> It would replace the 'nr_minors = BITS_TO_LONGS(end) * BITS_PER_LONG;' and hide the implementation details of the bitmap API.
>
> Something like:
> static __always_inline size_t bitmap_size(unsigned long nr_bits)
> {
>     return BITS_TO_LONGS(nr_bits) * sizeof(long);
> }
>

Yes, I think this would be a useful helper. Should be sizeof(unsigned long) though to keep things consistent.


-boris

\
 
 \ /
  Last update: 2021-12-06 14:32    [W:0.070 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site