lkml.org 
[lkml]   [2020]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v12 4/4] gpio: xilinx: Utilize generic bitmap_get_value and _set_value
On Mon, Nov 09, 2020 at 12:11:40PM -0500, William Breathitt Gray wrote:
> On Mon, Nov 09, 2020 at 10:15:29PM +0530, Syed Nayyar Waris wrote:
> > On Mon, Nov 09, 2020 at 03:41:53PM +0100, Arnd Bergmann wrote:

...

> > static inline void bitmap_set_value(unsigned long *map,
> > - unsigned long value,
> > + unsigned long value, const size_t length,
> > unsigned long start, unsigned long nbits)
> > {
> > const size_t index = BIT_WORD(start);
> > @@ -15,6 +15,10 @@ static inline void bitmap_set_value(unsigned long *map,
> > } else {
> > map[index + 0] &= ~BITMAP_FIRST_WORD_MASK(start);
> > map[index + 0] |= value << offset;
> > +
> > + if (index + 1 >= length)
> > + __builtin_unreachable();
> > +
> > map[index + 1] &= ~BITMAP_LAST_WORD_MASK(start + nbits);
> > map[index + 1] |= value >> space;
> > }
>
> Hi Syed,
>
> Let's rename 'length' to 'nbits' as Arnd suggested, and rename 'nbits'
> to value_width.

length here is in longs. I guess this is the point of entire patch.

But to me sounds like it would be better to have simply bitmap_set_value64() /
bitmap_set_value32() with proper optimization done and forget about variadic
ones for now.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2020-11-09 18:22    [W:0.128 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site