[PATCH 38/44] drm/xe/oa: Switch to use hrtimer_setup()

Nam Cao posted 44 patches 4 weeks ago
[PATCH 38/44] drm/xe/oa: Switch to use hrtimer_setup()
Posted by Nam Cao 4 weeks ago
There is a newly introduced hrtimer_setup() which will replace
hrtimer_init(). This new function is similar to the old one, except that it
also sanity-checks and initializes the timer's callback function.

Switch to use this new function.

Patch was created by using Coccinelle.

Signed-off-by: Nam Cao <namcao@linutronix.de>
---
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/xe/xe_oa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index eae38a49ee8e..600eaaee8a72 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -1437,8 +1437,8 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
 
 	WRITE_ONCE(u->exclusive_stream, stream);
 
-	hrtimer_init(&stream->poll_check_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
-	stream->poll_check_timer.function = xe_oa_poll_check_timer_cb;
+	hrtimer_setup(&stream->poll_check_timer, xe_oa_poll_check_timer_cb, CLOCK_MONOTONIC,
+		      HRTIMER_MODE_REL);
 	init_waitqueue_head(&stream->poll_wq);
 
 	spin_lock_init(&stream->oa_buffer.ptr_lock);
-- 
2.39.5
Re: [PATCH 38/44] drm/xe/oa: Switch to use hrtimer_setup()
Posted by Lucas De Marchi 3 weeks, 3 days ago
On Mon, Oct 28, 2024 at 08:35:14AM +0100, Nam Cao wrote:
>There is a newly introduced hrtimer_setup() which will replace
>hrtimer_init(). This new function is similar to the old one, except that it
>also sanity-checks and initializes the timer's callback function.
>
>Switch to use this new function.
>
>Patch was created by using Coccinelle.
>
>Signed-off-by: Nam Cao <namcao@linutronix.de>


Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>

Lucas De Marchi

>---
>Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>---
> drivers/gpu/drm/xe/xe_oa.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
>index eae38a49ee8e..600eaaee8a72 100644
>--- a/drivers/gpu/drm/xe/xe_oa.c
>+++ b/drivers/gpu/drm/xe/xe_oa.c
>@@ -1437,8 +1437,8 @@ static int xe_oa_stream_init(struct xe_oa_stream *stream,
>
> 	WRITE_ONCE(u->exclusive_stream, stream);
>
>-	hrtimer_init(&stream->poll_check_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
>-	stream->poll_check_timer.function = xe_oa_poll_check_timer_cb;
>+	hrtimer_setup(&stream->poll_check_timer, xe_oa_poll_check_timer_cb, CLOCK_MONOTONIC,
>+		      HRTIMER_MODE_REL);
> 	init_waitqueue_head(&stream->poll_wq);
>
> 	spin_lock_init(&stream->oa_buffer.ptr_lock);
>-- 
>2.39.5
>