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: Move timekeeping helper functions

Move timekeeping helper functions to prepare for their reuse.

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-10-adrian.hunter@intel.com

authored by

Adrian Hunter and committed by
Thomas Gleixner
e98ab3d4 7e90ffb7

+16 -16
+16 -16
kernel/time/timekeeping.c
··· 381 381 return nsec; 382 382 } 383 383 384 - static inline u64 timekeeping_get_ns(const struct tk_read_base *tkr) 385 - { 386 - u64 delta; 387 - 388 - delta = timekeeping_get_delta(tkr); 389 - return timekeeping_delta_to_ns(tkr, delta); 390 - } 391 - 392 384 static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) 393 385 { 394 386 u64 delta; 395 387 396 388 /* calculate the delta since the last update_wall_time */ 397 389 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); 390 + return timekeeping_delta_to_ns(tkr, delta); 391 + } 392 + 393 + static __always_inline u64 fast_tk_get_delta_ns(struct tk_read_base *tkr) 394 + { 395 + u64 delta, cycles = tk_clock_read(tkr); 396 + 397 + delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); 398 + return timekeeping_delta_to_ns(tkr, delta); 399 + } 400 + 401 + static inline u64 timekeeping_get_ns(const struct tk_read_base *tkr) 402 + { 403 + u64 delta; 404 + 405 + delta = timekeeping_get_delta(tkr); 398 406 return timekeeping_delta_to_ns(tkr, delta); 399 407 } 400 408 ··· 437 429 438 430 /* Update base[1] */ 439 431 memcpy(base + 1, base, sizeof(*base)); 440 - } 441 - 442 - static __always_inline u64 fast_tk_get_delta_ns(struct tk_read_base *tkr) 443 - { 444 - u64 delta, cycles = tk_clock_read(tkr); 445 - 446 - delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); 447 - return timekeeping_delta_to_ns(tkr, delta); 448 432 } 449 433 450 434 static __always_inline u64 __ktime_get_fast_ns(struct tk_fast *tkf)