gpio: Fix uninitialized variable bit in adp5588_irq_handler
authorAxel Lin <axel.lin@gmail.com>
Fri, 6 Apr 2012 12:37:43 +0000 (20:37 +0800)
committerGrant Likely <grant.likely@secretlab.ca>
Tue, 10 Apr 2012 20:20:55 +0000 (14:20 -0600)
The variable 'bit' is uninitialized in the first iteration of for
loop. Fix it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/gpio/gpio-adp5588.c

index 9ad1703d1408aa0c8661de5826e3247ddeaf3f30..ae5d7f12ce661f49900f9be1b7aec0d7374bdf90 100644 (file)
@@ -252,7 +252,7 @@ static irqreturn_t adp5588_irq_handler(int irq, void *devid)
                if (ret < 0)
                        memset(dev->irq_stat, 0, ARRAY_SIZE(dev->irq_stat));
 
-               for (bank = 0; bank <= ADP5588_BANK(ADP5588_MAXGPIO);
+               for (bank = 0, bit = 0; bank <= ADP5588_BANK(ADP5588_MAXGPIO);
                        bank++, bit = 0) {
                        pending = dev->irq_stat[bank] & dev->irq_mask[bank];