From 5db3aa9e9324301a58bdc270fce8cb068b57ae28 Mon Sep 17 00:00:00 2001 From: yushuailong Date: Fri, 11 Sep 2026 20:15:14 +0800 Subject: [PATCH] sched/clock: Avoid duplicate adjtime implementation. CLOCK_TIMEKEEPING already provides a software-based adjtime implementation. Exclude the generic adjtime state and entry point when timekeeping is enabled, while retaining clock_adjtime support for PTP clocks. Assisted-by: OpenAI Codex Signed-off-by: yushuailong --- sched/clock/clock_adjtime.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sched/clock/clock_adjtime.c b/sched/clock/clock_adjtime.c index 76771d44a50..5b970474fd0 100644 --- a/sched/clock/clock_adjtime.c +++ b/sched/clock/clock_adjtime.c @@ -50,6 +50,9 @@ * Private Data ****************************************************************************/ +/* CLOCK_TIMEKEEPING provides its own software-based adjtime(). */ + +#ifndef CONFIG_CLOCK_TIMEKEEPING static struct wdog_s g_adjtime_wdog; static long g_adjtime_ppb; static spinlock_t g_adjtime_lock = SP_UNLOCKED; @@ -216,6 +219,7 @@ int adjtime(FAR const struct timeval *delta, FAR struct timeval *olddelta) return OK; } } +#endif /* !CONFIG_CLOCK_TIMEKEEPING */ /**************************************************************************** * Name: nxclock_adjtime