|
Message-ID: <CAHp75VezhMm9R64y2A6mobQVqbLMLUKtzxQHp7uRDTBTMMzpRw@mail.gmail.com> Date: Sat, 19 May 2018 00:12:10 +0300 From: Andy Shevchenko <andy.shevchenko@...il.com> To: Geert Uytterhoeven <geert@...ux-m68k.org> Cc: Laura Abbott <labbott@...hat.com>, 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 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. -- With Best Regards, Andy Shevchenko
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.