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 <[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 a729a63 commit 9af4548

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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)