Skip to content

Commit

Permalink
pinctrl: sirf: fix typo for GPIO bank number
Browse files Browse the repository at this point in the history
The patch 7420d2d: "pinctrl: sirf: switch driver to use gpiolib
irqchip helpers" from Apr 15, 2014, leads to the following static
checker warning:

      drivers/pinctrl/sirf/pinctrl-sirf.c:578 sirfsoc_gpio_handle_irq()
      warn: buffer overflow 'sgpio_chip.sgpio_bank' 5 <= 31

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Barry Song authored and Linus Walleij committed May 27, 2014
1 parent de5af04 commit 648e42e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pinctrl/sirf/pinctrl-sirf.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,12 @@ static void sirfsoc_gpio_handle_irq(unsigned int irq, struct irq_desc *desc)
struct irq_chip *chip = irq_get_chip(irq);
int i;

for (i = 0; i < SIRFSOC_GPIO_BANK_SIZE; i++) {
for (i = 0; i < SIRFSOC_GPIO_NO_OF_BANKS; i++) {
bank = &sgpio_chip.sgpio_bank[i];
if (bank->parent_irq == irq)
break;
}
BUG_ON (i == SIRFSOC_GPIO_BANK_SIZE);
BUG_ON(i == SIRFSOC_GPIO_NO_OF_BANKS);

chained_irq_enter(chip, desc);

Expand Down

0 comments on commit 648e42e

Please sign in to comment.