diff options
author | Gary S. Robertson <gary.robertson@linaro.org> | 2014-09-10 14:57:16 -0500 |
---|---|---|
committer | Gary S. Robertson <gary.robertson@linaro.org> | 2015-07-22 16:17:09 -0500 |
commit | ec00161d4f2e22fa1587ed85d898be3caddf773f (patch) | |
tree | 2920d072e2ab4b9d28171f85747cfb94ed8fee6a | |
parent | f92531f05b031a8aade5c06d834effca90ab2275 (diff) |
hrtimer.h: prevent pinned timer state from breaking inactive test
An hrtimer may be pinned to a CPU but inactive, so it is no longer valid
to test the hrtimer.state struct member as having no bits set when inactive.
Changed the test function to mask out the HRTIMER_STATE_PINNED bit when
checking for inactive state.
Signed-off-by: Gary S. Robertson <gary.robertson@linaro.org>
-rw-r--r-- | include/linux/hrtimer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index d62e60a6bbe0..92b5824aff9b 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -414,7 +414,7 @@ extern ktime_t hrtimer_get_next_event(void); */ static inline int hrtimer_active(const struct hrtimer *timer) { - return timer->state != HRTIMER_STATE_INACTIVE; + return (timer->state & (~HRTIMER_STATE_PINNED)) != HRTIMER_STATE_INACTIVE; } /* |