Re: [PATCHv8] gpio: Remove VLA from gpiolib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 19, 2018 at 12:05 AM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> wrote:
> On Fri, May 18, 2018 at 10:07 PM, Andy Shevchenko
> <andy.shevchenko@xxxxxxxxx> wrote:
>> On Fri, May 18, 2018 at 8:53 PM, Laura Abbott <labbott@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux