Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 18 May 2018 08:51:09 +0200
From: Geert Uytterhoeven <>
To: Laura Abbott <>
Cc: Linus Walleij <>, Kees Cook <>, 
	Lukas Wunner <>, Rasmus Villemoes <>, 
	"open list:GPIO SUBSYSTEM" <>, 
	Linux Kernel Mailing List <>,, 
	Phil Reid <>
Subject: Re: [PATCHv7] gpio: Remove VLA from gpiolib

Hi Laura,

On Fri, May 18, 2018 at 12:32 AM, Laura Abbott <> wrote:
> The new challenge is to remove VLAs from the kernel
> (see to eventually
> turn on -Wvla.
> Using a kmalloc array is the easy way to fix this but kmalloc is still
> more expensive than stack allocation. Introduce a fast path with a
> fixed size stack array to cover most chip with gpios below some fixed
> amount. The slow path dynamically allocates an array to cover those
> chips with a large number of gpios.
> Reviewed-by: Phil Reid <>
> Reviewed-and-tested-by: Lukas Wunner <>
> Signed-off-by: Lukas Wunner <>
> Signed-off-by: Laura Abbott <>
> ---
> v7: Tweaked the Kconfig text to clarify the wording. Also fixed a few
> other comments from Geert, including the earlier suggestion to reduce
> the zeroing since I was wrong about that.

Thanks for the update!

With the minor nit below resolved:
Reviewed-by: Geert Uytterhoeven <>

> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -22,6 +22,18 @@ menuconfig GPIOLIB
> +       int "Maximum number of GPIOs for fast path"
> +       range 16 512

While you can indeed fit 2 * 16 bits in a long, a lower limit of 16 doesn't
make much sense, as you will use 2 longs (mask + bits) anyway.
So please increase it to 32.



Geert Uytterhoeven -- There's lots of Linux beyond ia32 --

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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.