From a49a5fd27f180585d3e0066a1f72fa44225afcc6 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Thu, 30 Oct 2025 19:42:06 +0800 Subject: [PATCH] sched/clock: Replace spinlock/sched_lock with spin_lock_irqsave_nopreempt Replace the spinlock/sched_lock pair in the sched clock module with spin_lock_irqsave_nopreempt() to improve code clarity and consistency. Signed-off-by: Chengdong Wang wangchengdong@lixiang.com --- sched/clock/clock_adjtime.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sched/clock/clock_adjtime.c b/sched/clock/clock_adjtime.c index c7028f4fd83..a46924b7033 100644 --- a/sched/clock/clock_adjtime.c +++ b/sched/clock/clock_adjtime.c @@ -115,8 +115,7 @@ static int adjtime_start(long long adjust_usec) ppb = -ppb_limit; } - flags = spin_lock_irqsave(&g_adjtime_lock); - sched_lock(); + flags = spin_lock_irqsave_nopreempt(&g_adjtime_lock); /* Set new adjustment */ @@ -142,8 +141,7 @@ static int adjtime_start(long long adjust_usec) wd_cancel(&g_adjtime_wdog); } - spin_unlock_irqrestore(&g_adjtime_lock, flags); - sched_unlock(); + spin_unlock_irqrestore_nopreempt(&g_adjtime_lock, flags); return ret; }