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

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.