lkml.org 
[lkml]   [2018]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCHv8] gpio: Remove VLA from gpiolib
On Sat, May 19, 2018 at 12:05 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
> On Fri, May 18, 2018 at 10:07 PM, Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Fri, May 18, 2018 at 8:53 PM, Laura Abbott <labbott@redhat.com> wrote:

>>> + bits = mask + BITS_TO_LONGS(chip->ngpio);
>>> + memset(mask, 0, BITS_TO_LONGS(chip->ngpio) * sizeof(*mask));
>>
>> Wouldn't be better
>>
>> bitmap_zero(mask, chip->ngpio);
>>
>> ?
>
> chip->ngpio is never const, so bitmap_zero() would always fall back to
> plain memset().

Yes. But it also much more readable and understandable here.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-05-18 23:13    [W:0.054 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site