linux-stable/drivers/ide
Kees Cook b7e389235c 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:45:01 +02:00
..
Kconfig treewide: simplify Kconfig dependencies for removed archs 2018-03-26 15:55:57 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
aec62xx.c
ali14xx.c
alim15x3.c alim15x3: move irq-restore before pci_dev_put() 2018-06-05 16:26:46 -04:00
amd74xx.c
atiixp.c
au1xxx-ide.c
buddha.c
cmd64x.c cmd64x: potential buffer overflow in cmd64x_program_timings() 2020-02-24 08:34:49 +01:00
cmd640.c
cs5520.c
cs5530.c
cs5535.c
cs5536.c
cy82c693.c
delkin_cb.c
dtc2278.c
falconide.c
gayle.c
hpt366.c ide: mark expected switch fall-throughs 2018-08-13 11:48:54 -07:00
ht6560b.c
icside.c
ide-4drives.c
ide-acpi.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
ide-atapi.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
ide-cd.c block: genhd: add 'groups' argument to device_add_disk 2021-03-11 14:04:59 +01:00
ide-cd.h block: Switch struct packet_command to use struct scsi_sense_hdr 2018-08-02 15:22:13 -06:00
ide-cd_ioctl.c block: Switch struct packet_command to use struct scsi_sense_hdr 2018-08-02 15:22:13 -06:00
ide-cd_verbose.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-cs.c
ide-devsets.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
ide-disk.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
ide-disk.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-disk_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-disk_proc.c ide: replace ->proc_fops with ->proc_show 2018-05-16 07:24:30 +02:00
ide-dma-sff.c
ide-dma.c ide: kill ide_toggle_bounce 2018-05-07 07:15:41 +02:00
ide-eh.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
ide-floppy.c ide: mark expected switch fall-throughs 2018-08-13 11:48:54 -07:00
ide-floppy.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-floppy_ioctl.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-floppy_proc.c ide: replace ->proc_fops with ->proc_show 2018-05-16 07:24:30 +02:00
ide-gd.c block: genhd: add 'groups' argument to device_add_disk 2021-03-11 14:04:59 +01:00
ide-gd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-generic.c treewide: simplify Kconfig dependencies for removed archs 2018-03-26 15:55:57 +02:00
ide-io-std.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
ide-io.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
ide-ioctls.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
ide-iops.c ide: don't enable/disable interrupts in force threaded-IRQ mode 2018-06-05 16:26:47 -04:00
ide-legacy.c
ide-lib.c ide: kill ide_toggle_bounce 2018-05-07 07:15:41 +02:00
ide-park.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
ide-pci-generic.c
ide-pio-blacklist.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ide-pm.c block: sanitize blk_get_request calling conventions 2018-05-14 08:55:12 -06:00
ide-pnp.c PNP: ide: constify pnp_device_id 2017-08-16 11:25:16 -07:00
ide-probe.c ide: mark expected switch fall-throughs 2018-08-13 11:48:54 -07:00
ide-proc.c ide: fix a typo in the settings proc file name 2019-01-31 08:14:42 +01:00
ide-scan-pci.c ide: fix IRQ assignment for PCI bus order probing 2017-10-03 14:03:31 -05:00
ide-sysfs.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
ide-tape.c ide-tape: remove redundant variable buffer_size 2018-08-13 11:48:54 -07:00
ide-taskfile.c ide: mark expected switch fall-throughs 2018-08-13 11:48:54 -07:00
ide-timings.c ide: avoid warning for timings calculation 2017-07-21 04:37:22 +01:00
ide-xfer-mode.c
ide.c treewide: Fix function prototypes for module_param_call() 2017-10-31 15:30:37 +01:00
ide_platform.c
it821x.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
it8172.c
it8213.c
jmicron.c
macide.c
ns87415.c
opti621.c
palm_bk3710.c
pdc202xx_new.c
pdc202xx_old.c
piix.c
pmac.c ide: pmac: add of_node_put() 2018-12-21 14:15:18 +01:00
q40ide.c
qd65xx.c
qd65xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rapide.c
rz1000.c
sc1200.c
serverworks.c ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-02-24 08:34:49 +01:00
setup-pci.c ide: pci: free PCI BARs on initialization failure 2017-10-03 14:02:57 -05:00
sgiioc4.c
siimage.c block: introduce new block status code type 2017-06-09 09:27:32 -06:00
sis5513.c ide: mark expected switch fall-throughs 2018-08-13 11:48:54 -07:00
sl82c105.c sl82c105: deprecate pci_get_bus_and_slot() 2018-01-11 17:29:04 -06:00
slc90e66.c
tc86c001.c
triflex.c
trm290.c
tx4938ide.c
tx4939ide.c
umc8672.c treewide: Remove uninitialized_var() usage 2023-08-11 11:45:01 +02:00
via82cxxx.c