linux-stable/fs/afs
Kees Cook d68627697d treewide: Remove uninitialized_var() usage
commit 3f649ab728 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:33:32 +02:00
..
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
afs.h
afs_cm.h
afs_fs.h
afs_vl.h
cache.c fscache: remove unused ->now_uncached callback 2017-09-06 17:27:26 -07:00
callback.c afs: Migrate vlocation fields to 64-bit 2017-03-16 16:27:46 +00:00
cell.c
cmservice.c afs: Connect up the CB.ProbeUuid 2017-12-14 09:53:15 +01:00
dir.c treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
file.c afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00
flock.c
fsclient.c afs: Populate and use client modification time 2017-03-16 16:27:47 +00:00
inode.c afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00
internal.h afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00
main.c uuid,afs: move struct uuid_v1 back into afs 2017-06-05 16:56:34 +02:00
misc.c rxrpc: Move the packet.h include file into net/rxrpc/ 2017-07-21 11:00:20 +01:00
mntpt.c afs: Add metadata xattrs 2017-07-09 14:40:12 -07:00
netdevices.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc.c
rxrpc.c afs: Fix some tracing details 2020-04-02 16:34:33 +02:00
security.c treewide: Remove uninitialized_var() usage 2023-08-11 11:33:32 +02:00
server.c afs: Migrate vlocation fields to 64-bit 2017-03-16 16:27:46 +00:00
super.c afs: Fix large file support 2020-01-27 14:46:51 +01:00
vlclient.c
vlocation.c afs: Migrate vlocation fields to 64-bit 2017-03-16 16:27:46 +00:00
vnode.c
volume.c afs: Convert to separately allocated bdi 2017-04-20 12:09:55 -06:00
write.c afs: Fix missing error handling in afs_write_end() 2018-03-03 10:24:32 +01:00
xattr.c afs: Fix the afs.cell and afs.volume xattr handlers 2020-01-27 14:46:33 +01:00