android_kernel_motorola_sm6225/kernel/locking
Kees Cook b7e389235c treewide: Remove uninitialized_var() usage
commit 3f649ab728cda8038259d8f14492fe400fbab911 upstream.

Using uninitialized_var() is dangerous as it papers over real bugs[1]
(or can in the future), and suppresses unrelated compiler warnings
(e.g. "unused variable"). If the compiler thinks it is uninitialized,
either simply initialize the variable or make compiler changes.

In preparation for removing[2] the[3] macro[4], remove all remaining
needless uses with the following script:

git grep '\buninitialized_var\b' | cut -d: -f1 | sort -u | \
	xargs perl -pi -e \
		's/\buninitialized_var\(([^\)]+)\)/\1/g;
		 s:\s*/\* (GCC be quiet|to make compiler happy) \*/$::g;'

drivers/video/fbdev/riva/riva_hw.c was manually tweaked to avoid
pathological white-space.

No outstanding warnings were found building allmodconfig with GCC 9.3.0
for x86_64, i386, arm64, arm, powerpc, powerpc64le, s390x, mips, sparc64,
alpha, and m68k.

[1] https://lore.kernel.org/lkml/20200603174714.192027-1-glider@google.com/
[2] https://lore.kernel.org/lkml/CA+55aFw+Vbj0i=1TGqCR5vQkCzWJ0QxK6CernOU6eedsudAixw@mail.gmail.com/
[3] https://lore.kernel.org/lkml/CA+55aFwgbgqhbp1fkxvRKEpzyR5J8n1vKT1VZdz9knmPuXhOeg@mail.gmail.com/
[4] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/

Reviewed-by: Leon Romanovsky <leonro@mellanox.com> # drivers/infiniband and mlx4/mlx5
Acked-by: Jason Gunthorpe <jgg@mellanox.com> # IB
Acked-by: Kalle Valo <kvalo@codeaurora.org> # wireless drivers
Reviewed-by: Chao Yu <yuchao0@huawei.com> # erofs
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-11 11:45:01 +02:00
..
lockdep.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
lockdep_internals.h
lockdep_proc.c locking/lockdep: Fix overflow in presentation of average lock-time 2020-09-03 11:24:21 +02:00
lockdep_states.h
locktorture.c locktorture: Print ratio of acquisitions, not failures 2020-04-23 10:30:23 +02:00
Makefile
mcs_spinlock.h locking/mcs: Use smp_cond_load_acquire() in MCS spin loop 2018-04-27 09:48:49 +02:00
mutex-debug.c locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
mutex-debug.h locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
mutex.c locking/mutex: Fix HANDOFF condition 2021-09-22 11:47:48 +02:00
mutex.h locking/mutex: clear MUTEX_FLAGS if wait_list is empty due to signal 2021-05-26 11:48:32 +02:00
osq_lock.c
percpu-rwsem.c
qrwlock.c locking/qrwlock: Fix ordering in queued_write_lock_slowpath() 2021-04-28 13:16:52 +02:00
qspinlock.c locking/qspinlock, x86: Provide liveness guarantee 2018-12-21 14:15:12 +01:00
qspinlock_paravirt.h Revert "locking/pvqspinlock: Don't wait if vCPU is preempted" 2019-10-11 18:21:06 +02:00
qspinlock_stat.h locking/qspinlock: Add stat tracking for pending vs. slowpath 2018-04-27 09:48:53 +02:00
rtmutex-debug.c
rtmutex-debug.h
rtmutex.c rtmutex: Remove unused argument from rt_mutex_proxy_unlock() 2021-01-30 13:32:12 +01:00
rtmutex.h
rtmutex_common.h rtmutex: Remove unused argument from rt_mutex_proxy_unlock() 2021-01-30 13:32:12 +01:00
rwsem-spinlock.c
rwsem-xadd.c locking/rwsem: Prevent decrement of reader count before increment 2019-05-22 07:37:34 +02:00
rwsem.c locking/rwsem: Fix up_read_non_owner() warning with DEBUG_RWSEMS 2018-06-20 11:29:23 +02:00
rwsem.h locking/rwsem: Add a new RWSEM_ANONYMOUSLY_OWNED flag 2018-05-16 11:45:15 +02:00
semaphore.c
spinlock.c
spinlock_debug.c locking/spinlock/debug: Fix various data races 2020-01-12 12:17:05 +01:00
test-ww_mutex.c locking/ww_mutex: Fix runtime warning in the WW mutex selftest 2018-10-03 08:56:31 +02:00