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.

timekeeping: Fold in timekeeping_delta_to_ns()

timekeeping_delta_to_ns() is now called only from
timekeeping_cycles_to_ns(), and it is not useful otherwise.

Simplify the code by folding it into timekeeping_cycles_to_ns().

No functional change.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240325064023.2997-16-adrian.hunter@intel.com

authored by

Adrian Hunter and committed by
Thomas Gleixner
3094c6db e84f43e3

+1 -12
+1 -12
kernel/time/timekeeping.c
··· 364 364 } 365 365 366 366 /* Timekeeper helper functions. */ 367 - 368 - static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 delta) 369 - { 370 - u64 nsec; 371 - 372 - nsec = delta * tkr->mult + tkr->xtime_nsec; 373 - nsec >>= tkr->shift; 374 - 375 - return nsec; 376 - } 377 - 378 367 static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) 379 368 { 380 369 /* Calculate the delta since the last update_wall_time() */ 381 370 u64 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); 382 371 383 - return timekeeping_delta_to_ns(tkr, delta); 372 + return ((delta * tkr->mult) + tkr->xtime_nsec) >> tkr->shift; 384 373 } 385 374 386 375 static __always_inline u64 __timekeeping_get_ns(const struct tk_read_base *tkr)