From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laura Abbott Subject: Re: [PATCHv8] gpio: Remove VLA from gpiolib Date: Mon, 21 May 2018 10:30:55 -0700 Message-ID: References: <20180518175304.20414-1-labbott@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: In-Reply-To: Content-Language: en-US To: Andy Shevchenko , Geert Uytterhoeven Cc: Linus Walleij , Kees Cook , Lukas Wunner , Rasmus Villemoes , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , kernel-hardening@lists.openwall.com, Phil Reid List-Id: linux-gpio@vger.kernel.org On 05/18/2018 02:12 PM, Andy Shevchenko wrote: > On Sat, May 19, 2018 at 12:05 AM, Geert Uytterhoeven > wrote: >> On Fri, May 18, 2018 at 10:07 PM, Andy Shevchenko >> wrote: >>> On Fri, May 18, 2018 at 8:53 PM, Laura Abbott 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.