Skip to content

Commit 9af4548

Browse files
ahunter6KAGA-KOKO
authored andcommitted
timekeeping: Tidy timekeeping_cycles_to_ns() slightly
Put together declaration and initialization of the local variable 'delta'. 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-12-adrian.hunter@intel.com
1 parent a729a63 commit 9af4548

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

kernel/time/timekeeping.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,9 @@ static inline u64 timekeeping_delta_to_ns(const struct tk_read_base *tkr, u64 de
383383

384384
static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles)
385385
{
386-
u64 delta;
386+
/* Calculate the delta since the last update_wall_time() */
387+
u64 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask);
387388

388-
/* calculate the delta since the last update_wall_time */
389-
delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask);
390389
return timekeeping_delta_to_ns(tkr, delta);
391390
}
392391

0 commit comments

Comments
 (0)