diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2015-05-19 12:06:37 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-05-19 12:06:37 +0930 |
commit | 897219d64e60ff6bbe7b08c0425b6741cb5f7a94 (patch) | |
tree | 64ff1bc125d12438dc417d6df8e4ce5a12eab72d | |
parent | fc3a762c6629caf4af8c490c8f9ccff5ac9e5a16 (diff) |
timer: fix timer_check() to iterate all levels.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | ccan/timer/timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ccan/timer/timer.c b/ccan/timer/timer.c index 0abf05cd..0d7deb12 100644 --- a/ccan/timer/timer.c +++ b/ccan/timer/timer.c @@ -360,7 +360,7 @@ struct timers *timers_check(const struct timers *timers, const char *abortstr) /* For other levels, "current" bucket has been emptied, and may contain * entries for the current + level_size bucket. */ - for (l = 1; timers->level[l] && l < PER_LEVEL; l++) { + for (l = 1; l < ARRAY_SIZE(timers->level) && timers->level[l]; l++) { uint64_t per_bucket = 1ULL << (TIMER_LEVEL_BITS * l); off = ((timers->base >> (l*TIMER_LEVEL_BITS)) % PER_LEVEL); |