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.

alarmtimer: Switch to use hrtimer_setup() and hrtimer_setup_on_stack()

hrtimer_setup() and hrtimer_setup_on_stack() take the callback function
pointer as argument and initialize the timer completely.

Replace the hrtimer_init*() variants and the open coded initialization of
hrtimer::function with the new setup mechanism.

Switch to use the new functions.

Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/2bae912336103405adcdab96b88d3ea0353b4228.1730386209.git.namcao@linutronix.de

authored by

Nam Cao and committed by
Thomas Gleixner
d82fadc7 fc9f59de

+4 -5
+4 -5
kernel/time/alarmtimer.c
··· 324 324 void (*function)(struct alarm *, ktime_t)) 325 325 { 326 326 timerqueue_init(&alarm->node); 327 - alarm->timer.function = alarmtimer_fired; 328 327 alarm->function = function; 329 328 alarm->type = type; 330 329 alarm->state = ALARMTIMER_STATE_INACTIVE; ··· 338 339 void alarm_init(struct alarm *alarm, enum alarmtimer_type type, 339 340 void (*function)(struct alarm *, ktime_t)) 340 341 { 341 - hrtimer_init(&alarm->timer, alarm_bases[type].base_clockid, 342 - HRTIMER_MODE_ABS); 342 + hrtimer_setup(&alarm->timer, alarmtimer_fired, alarm_bases[type].base_clockid, 343 + HRTIMER_MODE_ABS); 343 344 __alarm_init(alarm, type, function); 344 345 } 345 346 EXPORT_SYMBOL_GPL(alarm_init); ··· 756 757 alarm_init_on_stack(struct alarm *alarm, enum alarmtimer_type type, 757 758 void (*function)(struct alarm *, ktime_t)) 758 759 { 759 - hrtimer_init_on_stack(&alarm->timer, alarm_bases[type].base_clockid, 760 - HRTIMER_MODE_ABS); 760 + hrtimer_setup_on_stack(&alarm->timer, alarmtimer_fired, alarm_bases[type].base_clockid, 761 + HRTIMER_MODE_ABS); 761 762 __alarm_init(alarm, type, function); 762 763 } 763 764