linux-stable/include/linux/gpio
Bartosz Golaszewski 06863620ed gpiolib: convert the type of hwnum to unsigned int in gpiochip_get_desc()
gpiochip_get_desc() takes a u16 hwnum, but it turns out most users don't
respect that and usually pass an unsigned int. Since implicit casting to
a smaller type is dangerous - let's change the type of hwnum to unsigned
int in gpiochip_get_desc() and in gpiochip_request_own_desc() where the
size of hwnum is not respected either and who's a user of the former.

This is safe as we then check the hwnum against the number of lines
before proceeding in gpiochip_get_desc().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
2020-01-07 12:03:28 +01:00
..
aspeed.h gpio: aspeed: Add interfaces for co-processor to grab GPIOs 2018-07-02 16:10:15 +02:00
consumer.h gpiolib: introduce fwnode_gpiod_get_index() 2019-10-03 12:04:28 +02:00
driver.h gpiolib: convert the type of hwnum to unsigned int in gpiochip_get_desc() 2020-01-07 12:03:28 +01:00
gpio-reg.h gpio: Add comments on #if/#else/#endif 2019-06-27 15:56:50 +01:00
machine.h gpio: Add comments on #if/#else/#endif 2019-06-27 15:56:50 +01:00