Commit 6d0dbd30 authored by Kees Cook's avatar Kees Cook Committed by Chris Wilson

drm/i915/selftests: Convert timers to use timer_setup()

In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171024151344.GA104417@beastReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent 20ccd4d3
...@@ -49,9 +49,9 @@ void onstack_fence_fini(struct i915_sw_fence *fence) ...@@ -49,9 +49,9 @@ void onstack_fence_fini(struct i915_sw_fence *fence)
i915_sw_fence_fini(fence); i915_sw_fence_fini(fence);
} }
static void timed_fence_wake(unsigned long data) static void timed_fence_wake(struct timer_list *t)
{ {
struct timed_fence *tf = (struct timed_fence *)data; struct timed_fence *tf = from_timer(tf, t, timer);
i915_sw_fence_commit(&tf->fence); i915_sw_fence_commit(&tf->fence);
} }
...@@ -60,7 +60,7 @@ void timed_fence_init(struct timed_fence *tf, unsigned long expires) ...@@ -60,7 +60,7 @@ void timed_fence_init(struct timed_fence *tf, unsigned long expires)
{ {
onstack_fence_init(&tf->fence); onstack_fence_init(&tf->fence);
setup_timer_on_stack(&tf->timer, timed_fence_wake, (unsigned long)tf); timer_setup_on_stack(&tf->timer, timed_fence_wake, 0);
if (time_after(expires, jiffies)) if (time_after(expires, jiffies))
mod_timer(&tf->timer, expires); mod_timer(&tf->timer, expires);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment