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
This commit is contained in:
wangchengdong 2025-10-30 19:42:06 +08:00 • committed by Xiang Xiao
parent e6c982892b
commit a49a5fd27f

View file

@ -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;
}