rtc: t reaches -1, tested 0
PATCH 1/1 rtc: t reaches -1, tested 0
With a postfix decrement t will reach -1 rather than 0, so the warning nor errot_out occur.
Signed-off-by Roel Kluin <[email protected]>
---
drivers/rtc/rtc-au1xxx.c +1 -1
@@ -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) {
Quoted 4 lines · On Sun, 08 Feb 2009 15:10:30 +0100 Roel Kluin <[email protected]> wrote:
With a postfix decrement t will reach -1 rather than 0, so the warning nor
errot_outoccur.Signed-off-by Roel Kluin <[email protected]>
Acked-by Alessandro Zummo <[email protected]>
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it
Hey Roel,
Quoted 10 lines · On Sun, 08 Feb 2009 15:10:30 +0100 Roel Kluin <[email protected]> wrote:
With a postfix decrement t will reach -1 rather than 0, so the warning nor
errot_outoccur.Signed-off-by Roel Kluin <[email protected]>---
drivers/rtc/rtc-au1xxx.c +0
-0
drivers/rtc/rtc-au1xxx.c static int __devinit au1xtoy_rtc_probe(struct platform_device *pdev) · line 87
Quoted 8 lines
drivers/rtc/rtc-au1xxx.c +1
-1@@ -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 <[email protected]>