]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
stm class: heartbeat: Switch to use hrtimer_setup()
authorNam Cao <namcao@linutronix.de>
Wed, 5 Feb 2025 10:46:17 +0000 (11:46 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 18 Feb 2025 10:19:05 +0000 (11:19 +0100)
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: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/c822671342e6ca0437b25f8e24935f09821e389f.1738746904.git.namcao@linutronix.de
drivers/hwtracing/stm/heartbeat.c

index e9496fe97baa10f8c0115ef841b599fc66734a94..495eb1dc8ac585505c2e9156228afeac9a3f59d6 100644 (file)
@@ -81,10 +81,8 @@ static int stm_heartbeat_init(void)
                stm_heartbeat[i].data.type      = STM_USER;
                stm_heartbeat[i].data.link      = stm_heartbeat_link;
                stm_heartbeat[i].data.unlink    = stm_heartbeat_unlink;
-               hrtimer_init(&stm_heartbeat[i].hrtimer, CLOCK_MONOTONIC,
-                            HRTIMER_MODE_ABS);
-               stm_heartbeat[i].hrtimer.function =
-                       stm_heartbeat_hrtimer_handler;
+               hrtimer_setup(&stm_heartbeat[i].hrtimer, stm_heartbeat_hrtimer_handler,
+                             CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 
                ret = stm_source_register_device(NULL, &stm_heartbeat[i].data);
                if (ret)