git: 8758ac757fe6 - main - sched_4bsd: ts is only used in sched_bind for SMP.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 13 Apr 2022 23:09:45 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=8758ac757fe69e5504e7dc952341955791c10cf7

commit 8758ac757fe69e5504e7dc952341955791c10cf7
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-04-13 23:08:22 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-04-13 23:08:22 +0000

    sched_4bsd: ts is only used in sched_bind for SMP.
---
 sys/kern/sched_4bsd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/kern/sched_4bsd.c b/sys/kern/sched_4bsd.c
index 654d0a15037d..3715402854c7 100644
--- a/sys/kern/sched_4bsd.c
+++ b/sys/kern/sched_4bsd.c
@@ -1526,13 +1526,13 @@ sched_userret_slowpath(struct thread *td)
 void
 sched_bind(struct thread *td, int cpu)
 {
-	struct td_sched *ts;
+#ifdef SMP
+	struct td_sched *ts = td_get_sched(td);
+#endif
 
 	THREAD_LOCK_ASSERT(td, MA_OWNED|MA_NOTRECURSED);
 	KASSERT(td == curthread, ("sched_bind: can only bind curthread"));
 
-	ts = td_get_sched(td);
-
 	td->td_flags |= TDF_BOUND;
 #ifdef SMP
 	ts->ts_runq = &runq_pcpu[cpu];