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.

powercap: 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: Rafael J. Wysocki <rafael@kernel.org>
Acked-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://lore.kernel.org/all/fffc5ecc232069d91817b519dcafd8985120e51c.1738746904.git.namcao@linutronix.de

authored by

Nam Cao and committed by
Thomas Gleixner
d9a67240 5e55888e

+2 -4
+1 -2
drivers/powercap/idle_inject.c
··· 339 339 return NULL; 340 340 341 341 cpumask_copy(to_cpumask(ii_dev->cpumask), cpumask); 342 - hrtimer_init(&ii_dev->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 343 - ii_dev->timer.function = idle_inject_timer_fn; 342 + hrtimer_setup(&ii_dev->timer, idle_inject_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 344 343 ii_dev->latency_us = UINT_MAX; 345 344 ii_dev->update = update; 346 345
+1 -2
drivers/powercap/intel_rapl_common.c
··· 2064 2064 raw_spin_lock_init(&data->lock); 2065 2065 INIT_LIST_HEAD(&data->active_list); 2066 2066 data->timer_interval = ms_to_ktime(rapl_pmu.timer_ms); 2067 - hrtimer_init(&data->hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 2068 - data->hrtimer.function = rapl_hrtimer_handle; 2067 + hrtimer_setup(&data->hrtimer, rapl_hrtimer_handle, CLOCK_MONOTONIC, HRTIMER_MODE_REL); 2069 2068 2070 2069 return rapl_pmu_update(rp); 2071 2070 }