timekeeping: Let timekeeping_cycles_to_ns() handle both under and overflow
authorAdrian Hunter <adrian.hunter@intel.com>
Mon, 25 Mar 2024 06:40:22 +0000 (08:40 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 8 Apr 2024 13:03:08 +0000 (15:03 +0200)
commit135225a363ae67bc90bde7a2cbbe1ea0f152ba22
treef807bda1fb68e96c9537602e6bf66fa6478a6d40
parentfcf190c369149c3b04539797cedf28741eb14164
timekeeping: Let timekeeping_cycles_to_ns() handle both under and overflow

For the case !CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE, forego overflow
protection in the range (mask << 1) < delta <= mask, and interpret it
always as an inconsistency between CPU clock values. That allows
slightly neater code, and it is on a slow path so has no effect on
performance.

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-19-adrian.hunter@intel.com
kernel/time/timekeeping.c