[PATCH 2/4] timekeeping: Use timekeeper_is_core_tk() in timekeeping_update_on_shadow()

Thomas Weißschuh (Schneider Electric) <[email protected]>
Newsgroups org.kernel.vger.linux-kernel
Message-ID <20260812-timekeeping-conditionals-v1-2-75ebe366677d@linutronix.de>
If CONFIG_POSIX_AUX_CLOCKS is disabled, the timekeeper is known to be
the core timekeeper.

Use the helper to avoid the conditional at runtime in this case.

Signed-off-by: Thomas Weißschuh (Schneider Electric) <[email protected]>
---
 kernel/time/timekeeping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 2249d7fb3cb6..12bd61e9b5de 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -842,7 +842,7 @@ static void timekeeping_update_from_shadow(struct tk_data *tkd, unsigned int act
 	tk_update_ktime_data(tk);
 	tk->tkr_mono.base_real = tk->tkr_mono.base + tk->offs_real;
 
-	if (tk->id == TIMEKEEPER_CORE) {
+	if (timekeeper_is_core_tk(tk)) {
 		tk_update_ns_to_cyc(tk, &tkd->timekeeper);
 		update_vsyscall(tk);
 		update_pvclock_gtod(tk, action & TK_CLOCK_WAS_SET);

-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.