Skip to content

Commit c89538d

Browse files
tracing/osnoise: Switch to use hrtimer_setup()
JIRA: https://issues.redhat.com/browse/RHEL-117873 commit 19fec9c Author: Nam Cao <namcao@linutronix.de> Date: Wed Feb 5 11:39:08 2025 +0100 tracing/osnoise: Switch to use hrtimer_setup() hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Patch was created by using Coccinelle. Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Link: https://lore.kernel.org/all/ff8e6e11df5f928b2b97619ac847b4fa045376a1.1738746821.git.namcao@linutronix.de Signed-off-by: Tomas Glozar <tglozar@redhat.com>
1 parent 04ee8d1 commit c89538d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/trace/trace_osnoise.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,8 +1884,7 @@ static int timerlat_main(void *data)
18841884
tlat->count = 0;
18851885
tlat->tracing_thread = false;
18861886

1887-
hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
1888-
tlat->timer.function = timerlat_irq;
1887+
hrtimer_setup(&tlat->timer, timerlat_irq, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
18891888
tlat->kthread = current;
18901889
osn_var->pid = current->pid;
18911890
/*
@@ -2440,8 +2439,7 @@ static int timerlat_fd_open(struct inode *inode, struct file *file)
24402439
tlat = this_cpu_tmr_var();
24412440
tlat->count = 0;
24422441

2443-
hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
2444-
tlat->timer.function = timerlat_irq;
2442+
hrtimer_setup(&tlat->timer, timerlat_irq, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD);
24452443

24462444
migrate_enable();
24472445
return 0;

0 commit comments

Comments
 (0)