svn commit: r342248 - stable/12/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Wed Dec 19 22:31:21 UTC 2018


Author: mjg
Date: Wed Dec 19 22:31:20 2018
New Revision: 342248
URL: https://svnweb.freebsd.org/changeset/base/342248

Log:
  MFC r340410
  
  locks: plug warnings about unitialized variables
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  stable/12/sys/kern/kern_mutex.c
  stable/12/sys/kern/kern_rwlock.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/kern_mutex.c
==============================================================================
--- stable/12/sys/kern/kern_mutex.c	Wed Dec 19 22:30:26 2018	(r342247)
+++ stable/12/sys/kern/kern_mutex.c	Wed Dec 19 22:31:20 2018	(r342248)
@@ -486,7 +486,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v)
 	int64_t all_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-	int doing_lockprof;
+	int doing_lockprof = 0;
 #endif
 
 	td = curthread;
@@ -690,7 +690,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t
 	int64_t spin_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-	int doing_lockprof;
+	int doing_lockprof = 0;
 #endif
 
 	tid = (uintptr_t)curthread;

Modified: stable/12/sys/kern/kern_rwlock.c
==============================================================================
--- stable/12/sys/kern/kern_rwlock.c	Wed Dec 19 22:30:26 2018	(r342247)
+++ stable/12/sys/kern/kern_rwlock.c	Wed Dec 19 22:31:20 2018	(r342248)
@@ -445,7 +445,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, 
 	int64_t all_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-	uintptr_t state;
+	uintptr_t state = 0;
 	int doing_lockprof = 0;
 #endif
 
@@ -913,7 +913,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC
 	int64_t all_time = 0;
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
-	uintptr_t state;
+	uintptr_t state = 0;
 	int doing_lockprof = 0;
 #endif
 	int extra_work = 0;


More information about the svn-src-all mailing list