Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drivers: perf: 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: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/471ea3b829d14a4b4c3c7814dbe1ed13b15d47b8.1738746904.git.namcao@linutronix.de

authored by

Nam Cao and committed by
Thomas Gleixner
5f8401cf 563608c2

+6 -8
+2 -3
drivers/perf/arm-ccn.c
··· 1273 1273 /* No overflow interrupt? Have to use a timer instead. */ 1274 1274 if (!ccn->irq) { 1275 1275 dev_info(ccn->dev, "No access to interrupts, using timer.\n"); 1276 - hrtimer_init(&ccn->dt.hrtimer, CLOCK_MONOTONIC, 1277 - HRTIMER_MODE_REL); 1278 - ccn->dt.hrtimer.function = arm_ccn_pmu_timer_handler; 1276 + hrtimer_setup(&ccn->dt.hrtimer, arm_ccn_pmu_timer_handler, CLOCK_MONOTONIC, 1277 + HRTIMER_MODE_REL); 1279 1278 } 1280 1279 1281 1280 /* Pick one CPU which we will use to collect data from CCN... */
+2 -2
drivers/perf/marvell_cn10k_ddr_pmu.c
··· 1064 1064 if (!name) 1065 1065 return -ENOMEM; 1066 1066 1067 - hrtimer_init(&ddr_pmu->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 1068 - ddr_pmu->hrtimer.function = cn10k_ddr_pmu_timer_handler; 1067 + hrtimer_setup(&ddr_pmu->hrtimer, cn10k_ddr_pmu_timer_handler, CLOCK_MONOTONIC, 1068 + HRTIMER_MODE_REL); 1069 1069 1070 1070 cpuhp_state_add_instance_nocalls( 1071 1071 CPUHP_AP_PERF_ARM_MARVELL_CN10K_DDR_ONLINE,
+2 -3
drivers/perf/thunderx2_pmu.c
··· 752 752 tx2_pmu->cpu = cpu; 753 753 754 754 if (tx2_pmu->hrtimer_callback) { 755 - hrtimer_init(&tx2_pmu->hrtimer, 756 - CLOCK_MONOTONIC, HRTIMER_MODE_REL); 757 - tx2_pmu->hrtimer.function = tx2_pmu->hrtimer_callback; 755 + hrtimer_setup(&tx2_pmu->hrtimer, tx2_pmu->hrtimer_callback, CLOCK_MONOTONIC, 756 + HRTIMER_MODE_REL); 758 757 } 759 758 760 759 ret = tx2_uncore_pmu_register(tx2_pmu);