diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2013-11-11 03:08:21 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2013-11-11 03:08:21 +0000 |
commit | ab378f87dc16cf02fd42d9f7527e76e0f3413f86 (patch) | |
tree | 034a790f028003299e2e2ff991efa7302148a682 /sys/dev/ic/athn.c | |
parent | 51e03cc9e3148211a40d87e10ed632f88c7c4f27 (diff) |
replace things like "start + interval > ticks" with
"ticks - start > interval" because the latter copes with ticks wrapping.
pointed out by guenther@
Diffstat (limited to 'sys/dev/ic/athn.c')
-rw-r--r-- | sys/dev/ic/athn.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c index 0ae50c853fc..8f397534bbb 100644 --- a/sys/dev/ic/athn.c +++ b/sys/dev/ic/athn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: athn.c,v 1.76 2013/08/07 01:06:28 bluhm Exp $ */ +/* $OpenBSD: athn.c,v 1.77 2013/11/11 03:08:20 dlg Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1239,7 +1239,7 @@ athn_calib_to(void *arg) /* Do periodic (every 4 minutes) PA calibration. */ if (AR_SREV_9285_11_OR_LATER(sc) && !AR_SREV_9380_10_OR_LATER(sc) && - ticks >= sc->pa_calib_ticks + 240 * hz) { + (ticks - sc->pa_calib_ticks + 240 * hz) >= 0) { sc->pa_calib_ticks = ticks; if (AR_SREV_9271(sc)) ar9271_pa_calib(sc); |