Skip to content

Commit 3094c6d

Browse files
ahunter6KAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e84f43e commit 3094c6d

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

kernel/time/timekeeping.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -364,23 +364,12 @@ static void tk_setup_internals(struct timekeeper *tk, struct clocksource *clock)
364364
}
365365

366366
/* 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-
378367
static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles)
379368
{
380369
/* Calculate the delta since the last update_wall_time() */
381370
u64 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask);
382371

383-
return timekeeping_delta_to_ns(tkr, delta);
372+
return ((delta * tkr->mult) + tkr->xtime_nsec) >> tkr->shift;
384373
}
385374

386375
static __always_inline u64 __timekeeping_get_ns(const struct tk_read_base *tkr)

0 commit comments

Comments
 (0)