All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: t reaches -1, tested 0
@ 2009-02-08 14:10 Roel Kluin
  2009-02-08 18:23 ` Manuel Lauss
  2009-02-08 18:29 ` Alessandro Zummo
  0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-02-08 14:10 UTC (permalink / raw)
  To: mano, a.zummo; +Cc: rtc-linux, lkml

With a postfix decrement t will reach -1 rather than 0,
so the warning nor errot_out occur.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/rtc/rtc-au1xxx.c b/drivers/rtc/rtc-au1xxx.c
index 8906a68..979ed04 100644
--- a/drivers/rtc/rtc-au1xxx.c
+++ b/drivers/rtc/rtc-au1xxx.c
@@ -81,7 +81,7 @@ static int __devinit au1xtoy_rtc_probe(struct platform_device *pdev)
 	if (au_readl(SYS_TOYTRIM) != 32767) {
 		/* wait until hardware gives access to TRIM register */
 		t = 0x00100000;
-		while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && t--)
+		while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && --t)
 			msleep(1);
 
 		if (!t) {



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

* Re: [PATCH] rtc: t reaches -1, tested 0
  2009-02-08 14:10 [PATCH] rtc: t reaches -1, tested 0 Roel Kluin
@ 2009-02-08 18:23 ` Manuel Lauss
  2009-02-08 18:29 ` Alessandro Zummo
  1 sibling, 0 replies; 3+ messages in thread
From: Manuel Lauss @ 2009-02-08 18:23 UTC (permalink / raw)
  To: Roel Kluin; +Cc: a.zummo, rtc-linux, lkml

Hey Roel,

On Sun, 08 Feb 2009 15:10:30 +0100
Roel Kluin <roel.kluin@gmail.com> wrote:
> With a postfix decrement t will reach -1 rather than 0,
> so the warning nor errot_out occur.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/rtc/rtc-au1xxx.c b/drivers/rtc/rtc-au1xxx.c
> index 8906a68..979ed04 100644
> --- a/drivers/rtc/rtc-au1xxx.c
> +++ b/drivers/rtc/rtc-au1xxx.c
> @@ -81,7 +81,7 @@ static int __devinit au1xtoy_rtc_probe(struct platform_device *pdev)
>  	if (au_readl(SYS_TOYTRIM) != 32767) {
>  		/* wait until hardware gives access to TRIM register */
>  		t = 0x00100000;
> -		while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && t--)
> +		while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S) && --t)
>  			msleep(1);
>  
>  		if (!t) {

Thank you, obviously correct.

Acked-by: Manuel Lauss <mano@roarinelk.homelinux.net>

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

* Re: [PATCH] rtc: t reaches -1, tested 0
  2009-02-08 14:10 [PATCH] rtc: t reaches -1, tested 0 Roel Kluin
  2009-02-08 18:23 ` Manuel Lauss
@ 2009-02-08 18:29 ` Alessandro Zummo
  1 sibling, 0 replies; 3+ messages in thread
From: Alessandro Zummo @ 2009-02-08 18:29 UTC (permalink / raw)
  To: Roel Kluin; +Cc: mano, rtc-linux, lkml, akpm

On Sun, 08 Feb 2009 15:10:30 +0100
Roel Kluin <roel.kluin@gmail.com> wrote:

> With a postfix decrement t will reach -1 rather than 0,
> so the warning nor errot_out occur.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

 Acked-by: Alessandro Zummo <a.zummo@towertech.it>

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


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

end of thread, other threads:[~2009-02-08 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-08 14:10 [PATCH] rtc: t reaches -1, tested 0 Roel Kluin
2009-02-08 18:23 ` Manuel Lauss
2009-02-08 18:29 ` Alessandro Zummo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.