Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Nov 2017 23:27:06 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325963 - head/sys/kern
Message-ID:  <201711172327.vAHNR65d077600@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Nov 17 23:27:06 2017
New Revision: 325963
URL: https://svnweb.freebsd.org/changeset/base/325963

Log:
  locks: fix compilation issues without SMP or KDTRACE_HOOKS

Modified:
  head/sys/kern/kern_mutex.c
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Fri Nov 17 23:25:06 2017	(r325962)
+++ head/sys/kern/kern_mutex.c	Fri Nov 17 23:27:06 2017	(r325963)
@@ -462,9 +462,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v)
 	struct mtx *m;
 	struct turnstile *ts;
 	uintptr_t tid;
-#ifdef ADAPTIVE_MUTEXES
 	struct thread *owner;
-#endif
 #ifdef KTR
 	int cont_logged = 0;
 #endif
@@ -628,6 +626,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v)
 		 */
 #ifdef KDTRACE_HOOKS
 		sleep_time -= lockstat_nsecs(&m->lock_object);
+#endif
+#ifndef ADAPTIVE_MUTEXES
+		owner = mtx_owner(m);
 #endif
 		MPASS(owner == mtx_owner(m));
 		turnstile_wait(ts, owner, TS_EXCLUSIVE_QUEUE);

Modified: head/sys/kern/kern_sx.c
==============================================================================
--- head/sys/kern/kern_sx.c	Fri Nov 17 23:25:06 2017	(r325962)
+++ head/sys/kern/kern_sx.c	Fri Nov 17 23:27:06 2017	(r325963)
@@ -520,8 +520,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
 	uintptr_t state;
-	int extra_work;
 #endif
+	int extra_work = 0;
 
 	if (SCHEDULER_STOPPED())
 		return (0);
@@ -880,8 +880,8 @@ _sx_slock_hard(struct sx *sx, int opts, const char *fi
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
 	uintptr_t state;
-	int extra_work;
 #endif
+	int extra_work = 0;
 
 	if (SCHEDULER_STOPPED())
 		return (0);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711172327.vAHNR65d077600>