linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: Fix uninitialized variable bit in adp5588_irq_handler
@ 2012-04-06 12:37 Axel Lin
  2012-04-06 22:48 ` Grant Likely
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-04-06 12:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: Michael Hennerich, Grant Likely, Linus Walleij

The variable 'bit' is uninitialized in the first iteration of for loop. Fix it.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/gpio/gpio-adp5588.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
index 9ad1703..ae5d7f1 100644
--- a/drivers/gpio/gpio-adp5588.c
+++ b/drivers/gpio/gpio-adp5588.c
@@ -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];
 
-- 
1.7.5.4




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

* Re: [PATCH] gpio: Fix uninitialized variable bit in adp5588_irq_handler
  2012-04-06 12:37 [PATCH] gpio: Fix uninitialized variable bit in adp5588_irq_handler Axel Lin
@ 2012-04-06 22:48 ` Grant Likely
  0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2012-04-06 22:48 UTC (permalink / raw)
  To: Axel Lin, linux-kernel; +Cc: Michael Hennerich, Linus Walleij

On Fri, 06 Apr 2012 20:37:43 +0800, Axel Lin <axel.lin@gmail.com> wrote:
> The variable 'bit' is uninitialized in the first iteration of for loop. Fix it.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Applied, and will merge for v3.4.  THanks.

g.

> ---
>  drivers/gpio/gpio-adp5588.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c
> index 9ad1703..ae5d7f1 100644
> --- a/drivers/gpio/gpio-adp5588.c
> +++ b/drivers/gpio/gpio-adp5588.c
> @@ -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];
>  
> -- 
> 1.7.5.4
> 
> 
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.

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

end of thread, other threads:[~2012-04-07  1:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-06 12:37 [PATCH] gpio: Fix uninitialized variable bit in adp5588_irq_handler Axel Lin
2012-04-06 22:48 ` Grant Likely

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).