Skip to content

Commit

Permalink
gpio: fix aspeed_gpio_banks array size check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasyl Gomonovych authored and Linus Walleij committed Dec 28, 2017
1 parent bd8ed93 commit fe13862
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit fe13862

Please sign in to comment.