mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 05:44:11 +00:00
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
This commit is contained in:
parent
88b39600da
commit
c185a16ece
2 changed files with 7 additions and 2 deletions
|
@ -87,7 +87,7 @@ bool i915_error_injected(void)
|
|||
|
||||
void cancel_timer(struct timer_list *t)
|
||||
{
|
||||
if (!READ_ONCE(t->expires))
|
||||
if (!timer_active(t))
|
||||
return;
|
||||
|
||||
del_timer(t);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue