linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: fix aspeed_gpio_banks array size check
@ 2017-12-21 15:55 Vasyl Gomonovych
  2017-12-28 12:53 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Vasyl Gomonovych @ 2017-12-21 15:55 UTC (permalink / raw)
  To: joel, linus.walleij, linux-gpio, gomonovych; +Cc: linux-kernel

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

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 drivers/gpio/gpio-aspeed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 6b3ca6601af2..aac532837b81 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -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];
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpio: fix aspeed_gpio_banks array size check
  2017-12-21 15:55 [PATCH] gpio: fix aspeed_gpio_banks array size check Vasyl Gomonovych
@ 2017-12-28 12:53 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2017-12-28 12:53 UTC (permalink / raw)
  To: Vasyl Gomonovych; +Cc: Joel Stanley, linux-gpio, linux-kernel@vger.kernel.org

On Thu, Dec 21, 2017 at 4:55 PM, Vasyl Gomonovych <gomonovych@gmail.com> wrote:

> The test should be >= ARRAY_SIZE() instead of > ARRAY_SIZE().
>
> Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>

Patch applied.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-28 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 15:55 [PATCH] gpio: fix aspeed_gpio_banks array size check Vasyl Gomonovych
2017-12-28 12:53 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).