public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: tries reaches -1
@ 2009-01-29 15:29 Roel Kluin
  2009-01-29 18:29 ` Mark Brown
  2009-02-06 13:58 ` Samuel Ortiz
  0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-01-29 15:29 UTC (permalink / raw)
  To: broonie, sameo; +Cc: lkml

With a postfix decrement tries will reach -1 rather than 0,
so the warning will not be issued even upon timeout.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
index f92595c..2e0e5c2 100644
--- a/drivers/mfd/wm8350-core.c
+++ b/drivers/mfd/wm8350-core.c
@@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
 	do {
 		schedule_timeout_interruptible(1);
 		reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
-	} while (tries-- && (reg & WM8350_AUXADC_POLL));
+	} while (--tries && (reg & WM8350_AUXADC_POLL));
 
 	if (!tries)
 		dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);


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

* Re: [PATCH] mfd: tries reaches -1
  2009-01-29 15:29 [PATCH] mfd: tries reaches -1 Roel Kluin
@ 2009-01-29 18:29 ` Mark Brown
  2009-02-06 13:58 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2009-01-29 18:29 UTC (permalink / raw)
  To: Roel Kluin; +Cc: sameo, lkml

On Thu, Jan 29, 2009 at 04:29:09PM +0100, Roel Kluin wrote:
> With a postfix decrement tries will reach -1 rather than 0,
> so the warning will not be issued even upon timeout.

> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied, thanks.  I'll add this to my queue of things I'm pushing to
Samuel.

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

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

* Re: [PATCH] mfd: tries reaches -1
  2009-01-29 15:29 [PATCH] mfd: tries reaches -1 Roel Kluin
  2009-01-29 18:29 ` Mark Brown
@ 2009-02-06 13:58 ` Samuel Ortiz
  1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2009-02-06 13:58 UTC (permalink / raw)
  To: Roel Kluin; +Cc: broonie, lkml

On Thu, Jan 29, 2009 at 04:29:09PM +0100, Roel Kluin wrote:
> With a postfix decrement tries will reach -1 rather than 0,
> so the warning will not be issued even upon timeout.
Thanks Roel, applied.

 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/mfd/wm8350-core.c b/drivers/mfd/wm8350-core.c
> index f92595c..2e0e5c2 100644
> --- a/drivers/mfd/wm8350-core.c
> +++ b/drivers/mfd/wm8350-core.c
> @@ -1111,7 +1111,7 @@ int wm8350_read_auxadc(struct wm8350 *wm8350, int channel, int scale, int vref)
>  	do {
>  		schedule_timeout_interruptible(1);
>  		reg = wm8350_reg_read(wm8350, WM8350_DIGITISER_CONTROL_1);
> -	} while (tries-- && (reg & WM8350_AUXADC_POLL));
> +	} while (--tries && (reg & WM8350_AUXADC_POLL));
>  
>  	if (!tries)
>  		dev_err(wm8350->dev, "adc chn %d read timeout\n", channel);
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

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

end of thread, other threads:[~2009-02-06 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-29 15:29 [PATCH] mfd: tries reaches -1 Roel Kluin
2009-01-29 18:29 ` Mark Brown
2009-02-06 13:58 ` Samuel Ortiz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox