[tip: locking/core] x86/tsc: Make __use_tsc __ro_after_init

From: tip-bot2 for Valentin Schneider
Date: Fri Mar 22 2024 - 06:58:30 EST


The following commit has been merged into the locking/core branch of tip:

Commit-ID: 79a4567b2e8ae4d0282602a24f76f5e2382f5b98
Gitweb: https://git.kernel.org/tip/79a4567b2e8ae4d0282602a24f76f5e2382f5b98
Author: Valentin Schneider <vschneid@xxxxxxxxxx>
AuthorDate: Wed, 13 Mar 2024 19:01:06 +01:00
Committer: Ingo Molnar <mingo@xxxxxxxxxx>
CommitterDate: Fri, 22 Mar 2024 11:18:20 +01:00

x86/tsc: Make __use_tsc __ro_after_init

__use_tsc is only ever enabled in __init tsc_enable_sched_clock(), so mark
it as __ro_after_init.

Signed-off-by: Valentin Schneider <vschneid@xxxxxxxxxx>
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
Link: https://lore.kernel.org/r/20240313180106.2917308-5-vschneid@xxxxxxxxxx
---
arch/x86/kernel/tsc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 5a69a49..0f7624e 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -44,7 +44,7 @@ EXPORT_SYMBOL(tsc_khz);
static int __read_mostly tsc_unstable;
static unsigned int __initdata tsc_early_khz;

-static DEFINE_STATIC_KEY_FALSE(__use_tsc);
+static DEFINE_STATIC_KEY_FALSE_RO(__use_tsc);

int tsc_clocksource_reliable;