Re: [PATCH 1/3] x86/tsc: Replace magic constants with xxx_PER_SEC
From: Thorsten Blum
Date: Fri Oct 09 2026 - 09:53:17 EST
On Fri, Oct 09, 2026 at 12:04:34PM +0200, Petr Tesarik wrote:
> Make it clear that these constants refer to the conversion between seconds
> and milliseconds or nanoseconds.
>
> No functional change intended.
>
> Signed-off-by: Petr Tesarik <ptesarik@xxxxxxxx>
> ---
> arch/x86/kernel/tsc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 723347e2cf7f8..bac81d37a90ce 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -253,7 +253,7 @@ noinstr u64 native_sched_clock(void)
> */
>
> /* No locking but a rare wrong value is not a big deal: */
> - return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
> + return (jiffies_64 - INITIAL_JIFFIES) * (NSEC_PER_SEC / HZ);
> }
Maybe use TICK_NSEC here?