posix-timers: Store k_clock pointer in k_itimer
Having the k_clock pointer in the k_itimer struct avoids the lookup in several code pathes and makes the next steps of unification of the hrtimer and alarmtimer based posix timers simpler. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: John Stultz <john.stultz@linaro.org> Link: http://lkml.kernel.org/r/20170530211656.641222072@linutronix.de
This commit is contained in:
@@ -324,6 +324,8 @@ static int posix_cpu_timer_create(struct k_itimer *new_timer)
|
||||
if (CPUCLOCK_WHICH(new_timer->it_clock) >= CPUCLOCK_MAX)
|
||||
return -EINVAL;
|
||||
|
||||
new_timer->kclock = &clock_posix_cpu;
|
||||
|
||||
INIT_LIST_HEAD(&new_timer->it.cpu.entry);
|
||||
|
||||
rcu_read_lock();
|
||||
|
Reference in New Issue
Block a user