diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-07 12:35:40 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2021-01-07 21:37:14 +0000 |
commit | c185a16eceae8c9ea29602a3af0cb3071d32af6e (patch) | |
tree | d91714b8d2b9e36d7c9fef26ab8c3c6c4d1068ea /drivers/gpu/drm/i915/i915_utils.h | |
parent | drm/i915/selftests: Improve handling of iomem around stolen (diff) | |
download | linux-dev-c185a16eceae8c9ea29602a3af0cb3071d32af6e.tar.xz linux-dev-c185a16eceae8c9ea29602a3af0cb3071d32af6e.zip |
drm/i915: Wrap our timer_list.expires checking
Refactor our timer_list.expires checking into its own timer_active()
helper.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210107123541.17153-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_utils.h')
-rw-r--r-- | drivers/gpu/drm/i915/i915_utils.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h index 54773371e6bd..abd4dcd9f79c 100644 --- a/drivers/gpu/drm/i915/i915_utils.h +++ b/drivers/gpu/drm/i915/i915_utils.h @@ -438,9 +438,14 @@ static inline void __add_taint_for_CI(unsigned int taint) void cancel_timer(struct timer_list *t); void set_timer_ms(struct timer_list *t, unsigned long timeout); +static inline bool timer_active(const struct timer_list *t) +{ + return READ_ONCE(t->expires); +} + static inline bool timer_expired(const struct timer_list *t) { - return READ_ONCE(t->expires) && !timer_pending(t); + return timer_active(t) && !timer_pending(t); } /* |