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.

hrtimers: Introduce hrtimer_setup_sleeper_on_stack()

The hrtimer_init*() API is replaced by hrtimer_setup*() variants to
initialize the timer including the callback function at once.

hrtimer_init_sleeper_on_stack() does not need user to setup the callback
function separately, so a new variant would not be strictly necessary.

Nonetheless, to keep the naming convention consistent, introduce
hrtimer_setup_sleeper_on_stack(). hrtimer_init_on_stack() will be removed
once all users are converted.

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

authored by

Nam Cao and committed by
Thomas Gleixner
c9bd83ab 444cb7db

+16
+2
include/linux/hrtimer.h
··· 238 238 extern void hrtimer_init_sleeper_on_stack(struct hrtimer_sleeper *sl, 239 239 clockid_t clock_id, 240 240 enum hrtimer_mode mode); 241 + extern void hrtimer_setup_sleeper_on_stack(struct hrtimer_sleeper *sl, clockid_t clock_id, 242 + enum hrtimer_mode mode); 241 243 242 244 #ifdef CONFIG_DEBUG_OBJECTS_TIMERS 243 245 extern void destroy_hrtimer_on_stack(struct hrtimer *timer);
+14
kernel/time/hrtimer.c
··· 2065 2065 } 2066 2066 EXPORT_SYMBOL_GPL(hrtimer_init_sleeper_on_stack); 2067 2067 2068 + /** 2069 + * hrtimer_setup_sleeper_on_stack - initialize a sleeper in stack memory 2070 + * @sl: sleeper to be initialized 2071 + * @clock_id: the clock to be used 2072 + * @mode: timer mode abs/rel 2073 + */ 2074 + void hrtimer_setup_sleeper_on_stack(struct hrtimer_sleeper *sl, 2075 + clockid_t clock_id, enum hrtimer_mode mode) 2076 + { 2077 + debug_init_on_stack(&sl->timer, clock_id, mode); 2078 + __hrtimer_init_sleeper(sl, clock_id, mode); 2079 + } 2080 + EXPORT_SYMBOL_GPL(hrtimer_setup_sleeper_on_stack); 2081 + 2068 2082 int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts) 2069 2083 { 2070 2084 switch(restart->nanosleep.type) {