Skip to contentSkip to conversation

gpio: fix aspeed_gpio_banks array size check

PATCH In review Vasyl Gomonovych 2 participants 2 messages Dec 21, 2017 – Dec 28, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio: fix aspeed_gpio_banks array size check

The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().

---
 drivers/gpio/gpio-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-aspeed.c +1 -1
index 6b3ca6601af2..aac532837b81 100644
@@ -140,7 +140,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];
 }
 
Signature · 1 line
1.9.1