OpenCloudOS-Kernel/tools/virtio/linux
Kees Cook 63a0895d96 compiler: Remove uninitialized_var() macro
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.

As recommended[2] by[3] Linus[4], remove the macro. With the recent
change to disable -Wmaybe-uninitialized in v5.7 in commit 78a5255ffb
("Stop the ad-hoc games with -Wno-maybe-initialized"), this is likely
the best time to make this treewide change.

[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/

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
2020-07-16 12:35:31 -07:00
..
bug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compiler.h tools/virtio: define aligned attribute 2020-04-17 06:05:29 -04:00
device.h tools/virtio: virtio_test tool 2010-12-09 16:00:22 +02:00
dma-mapping.h tools/virtio: more stubs 2019-10-11 09:27:27 -04:00
err.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
export.h tools/virtio: fix build after 4.2 changes 2015-09-09 22:03:30 +03:00
hrtimer.h tools/virtio: add linux/hrtimer.h stub 2012-02-28 09:13:14 +02:00
irqreturn.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
kernel.h compiler: Remove uninitialized_var() macro 2020-07-16 12:35:31 -07:00
kmemleak.h tools/virtio: fix missing kmemleak_ignore symbol 2014-03-13 11:23:25 +10:30
module.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
printk.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
ratelimit.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
scatterlist.h sg: remove ->sg_magic member 2018-06-29 08:48:06 -06:00
slab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
thread_info.h tools/virtio: more stubs to fix tools build 2018-01-29 12:02:54 -05:00
uaccess.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uio.h tools/virtio: add vring_test. 2013-03-20 14:06:04 +10:30
virtio.h tools/virtio: Use tools/include/list.h instead of stubs 2020-06-22 12:34:22 -04:00
virtio_byteorder.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
virtio_config.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
virtio_ring.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30
vringh.h tools/virtio: separate headers more. 2013-03-20 14:00:42 +10:30