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: 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

authored by

Adrian Hunter and committed by
Thomas Gleixner
9af4548e a729a63c

+2 -3
+2 -3
kernel/time/timekeeping.c
··· 383 383 384 384 static inline u64 timekeeping_cycles_to_ns(const struct tk_read_base *tkr, u64 cycles) 385 385 { 386 - u64 delta; 386 + /* Calculate the delta since the last update_wall_time() */ 387 + u64 delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); 387 388 388 - /* calculate the delta since the last update_wall_time */ 389 - delta = clocksource_delta(cycles, tkr->cycle_last, tkr->mask); 390 389 return timekeeping_delta_to_ns(tkr, delta); 391 390 } 392 391