1
0
Fork 0
alistair23-linux/include/linux/gpio
Laura Abbott 3027743f83 gpio: Remove VLA from gpiolib
The new challenge is to remove VLAs from the kernel
(see https://lkml.org/lkml/2018/3/7/621) 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: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Phil Reid <preid@electromag.com.au>
Reviewed-and-tested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Laura Abbott <labbott@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2018-05-23 14:01:03 +02:00
..
consumer.h gpio: Remove VLA from gpiolib 2018-05-23 14:01:03 +02:00
driver.h gpiolib: Support 'gpio-reserved-ranges' property 2018-03-27 15:34:20 +02:00
gpio-reg.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
machine.h gpiolib: add hogs support for machine code 2018-05-16 14:35:24 +02:00