summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-aspeed.c
diff options
context:
space:
mode:
authorVasyl Gomonovych <gomonovych@gmail.com>2017-12-21 16:55:10 +0100
committerLinus Walleij <linus.walleij@linaro.org>2017-12-28 13:53:06 +0100
commitfe13862c9cad6f7d7d4faa97f546eb94d4989f44 (patch)
tree05de288d2f0de370bfdd4cb36e5d7f62830e4ec7 /drivers/gpio/gpio-aspeed.c
parentRevert "pinctrl: qcom: disable GPIO groups with no pins" (diff)
downloadlinux-fe13862c9cad6f7d7d4faa97f546eb94d4989f44.tar.xz
linux-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 <gomonovych@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to '')
-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];
}