linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Laura Abbott <labbott@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Kees Cook <keescook@chromium.org>, Lukas Wunner <lukas@wunner.de>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	kernel-hardening@lists.openwall.com,
	Phil Reid <preid@electromag.com.au>
Subject: Re: [PATCHv8] gpio: Remove VLA from gpiolib
Date: Mon, 21 May 2018 10:30:55 -0700	[thread overview]
Message-ID: <fc2fb457-57eb-d929-1061-5bc00ee218a8@redhat.com> (raw)
In-Reply-To: <CAHp75VezhMm9R64y2A6mobQVqbLMLUKtzxQHp7uRDTBTMMzpRw@mail.gmail.com>

On 05/18/2018 02:12 PM, Andy Shevchenko wrote:
> 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.
> 

I wasn't aware of that API. I'll switch to that.

      reply	other threads:[~2018-05-21 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-18 17:53 [PATCHv8] gpio: Remove VLA from gpiolib Laura Abbott
2018-05-18 20:07 ` Andy Shevchenko
2018-05-18 21:05   ` Geert Uytterhoeven
2018-05-18 21:12     ` Andy Shevchenko
2018-05-21 17:30       ` Laura Abbott [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc2fb457-57eb-d929-1061-5bc00ee218a8@redhat.com \
    --to=labbott@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lukas@wunner.de \
    --cc=preid@electromag.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).