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>
This commit is contained in:
parent
bd8ed930af
commit
fe13862c9c
|
@ -149,7 +149,7 @@ static const struct aspeed_gpio_bank *to_bank(unsigned int offset)
|
||||||
{
|
{
|
||||||
unsigned int bank = GPIO_BANK(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];
|
return &aspeed_gpio_banks[bank];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue