[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fc2fb457-57eb-d929-1061-5bc00ee218a8@redhat.com>
Date: Mon, 21 May 2018 10:30:55 -0700
From: Laura Abbott <labbott@...hat.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Kees Cook <keescook@...omium.org>,
Lukas Wunner <lukas@...ner.de>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kernel-hardening@...ts.openwall.com,
Phil Reid <preid@...ctromag.com.au>
Subject: Re: [PATCHv8] gpio: Remove VLA from gpiolib
On 05/18/2018 02:12 PM, Andy Shevchenko wrote:
> On Sat, May 19, 2018 at 12:05 AM, Geert Uytterhoeven
> <geert@...ux-m68k.org> wrote:
>> On Fri, May 18, 2018 at 10:07 PM, Andy Shevchenko
>> <andy.shevchenko@...il.com> wrote:
>>> On Fri, May 18, 2018 at 8:53 PM, Laura Abbott <labbott@...hat.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.
>
I wasn't aware of that API. I'll switch to that.
Powered by blists - more mailing lists