mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
m68k: cnt reaches -1, not 0
With the postfix decrement cnt reaches -1 rather than 0. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
This commit is contained in:
parent
dac9ff79a8
commit
dd9b3e84f2
1 changed files with 4 additions and 2 deletions
|
@ -574,10 +574,11 @@ static int a2000_hwclk(int op, struct rtc_time *t)
|
||||||
|
|
||||||
tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD;
|
tod_2000.cntrl1 = TOD2000_CNTRL1_HOLD;
|
||||||
|
|
||||||
while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
|
while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt) {
|
||||||
tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
|
tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
|
||||||
udelay(70);
|
udelay(70);
|
||||||
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
|
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
|
||||||
|
--cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cnt)
|
if (!cnt)
|
||||||
|
@ -649,10 +650,11 @@ static int amiga_set_clock_mmss(unsigned long nowtime)
|
||||||
|
|
||||||
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
|
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
|
||||||
|
|
||||||
while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt--) {
|
while ((tod_2000.cntrl1 & TOD2000_CNTRL1_BUSY) && cnt) {
|
||||||
tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
|
tod_2000.cntrl1 &= ~TOD2000_CNTRL1_HOLD;
|
||||||
udelay(70);
|
udelay(70);
|
||||||
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
|
tod_2000.cntrl1 |= TOD2000_CNTRL1_HOLD;
|
||||||
|
--cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cnt)
|
if (!cnt)
|
||||||
|
|
Loading…
Reference in a new issue