aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-aspeed.c
diff options
context:
space:
mode:
authorVasyl Gomonovych <[email protected]>2017-12-21 15:55:10 +0000
committerLinus Walleij <[email protected]>2017-12-28 12:53:06 +0000
commitfe13862c9cad6f7d7d4faa97f546eb94d4989f44 (patch)
tree05de288d2f0de370bfdd4cb36e5d7f62830e4ec7 /drivers/gpio/gpio-aspeed.c
parentRevert "pinctrl: qcom: disable GPIO groups with no pins" (diff)
downloadkernel-fe13862c9cad6f7d7d4faa97f546eb94d4989f44.tar.gz
kernel-fe13862c9cad6f7d7d4faa97f546eb94d4989f44.zip
gpio: fix aspeed_gpio_banks array size check
The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE(). Signed-off-by: Vasyl Gomonovych <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-aspeed.c')
-rw-r--r--drivers/gpio/gpio-aspeed.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 30bc97b81bec..77e485557498 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -149,7 +149,7 @@ static const struct aspeed_gpio_bank *to_bank(unsigned int offset)
{
unsigned int bank = GPIO_BANK(offset);
- WARN_ON(bank > ARRAY_SIZE(aspeed_gpio_banks));
+ WARN_ON(bank >= ARRAY_SIZE(aspeed_gpio_banks));
return &aspeed_gpio_banks[bank];
}