diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2018-11-13 21:29:56 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2018-11-13 21:29:56 +0000 |
commit | f183fb162c1dbc58cc3f7e2c27891bd881db2bf2 (patch) | |
tree | 26a93605354b6e9d5c353d52f37583605751c49b /sys/kern/kern_mutex.c | |
parent | d54474e63b501c18d61de3bedd0337cc8a633926 (diff) | |
download | src-f183fb162c1dbc58cc3f7e2c27891bd881db2bf2.tar.gz src-f183fb162c1dbc58cc3f7e2c27891bd881db2bf2.zip |
locks: plug warnings about unitialized variables
They only showed up after I redefined LOCKSTAT_ENABLED to 0.
doing_lockprof in mutex.c is a real (but harmless) bug. Should the
value be non-zero it will do checks for lock profiling which would
otherwise be skipped.
state in rwlock.c is a wart from the compiler, the value can't be
used if lock profiling is not enabled.
Sponsored by: The FreeBSD Foundation
Notes
Notes:
svn path=/head/; revision=340410
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r-- | sys/kern/kern_mutex.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index 65c2e299bbc7..a35cd3b834fb 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -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 v) 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; |