mirror of https://gitee.com/openkylin/linux.git
56410c0cb4
Clang warns:
drivers/char/hw_random/optee-rng.c:80:31: warning: suggest braces around
initialization of subobject [-Wmissing-braces]
struct tee_param param[4] = {0};
^
{}
drivers/char/hw_random/optee-rng.c:177:31: warning: suggest braces
around initialization of subobject [-Wmissing-braces]
struct tee_param param[4] = {0};
^
{}
drivers/char/hw_random/optee-rng.c:212:48: warning: suggest braces
around initialization of subobject [-Wmissing-braces]
struct tee_ioctl_open_session_arg sess_arg = {0};
^
{}
3 warnings generated.
One way to fix these warnings is to add additional braces like Clang
suggests; however, there has been a bit of push back from some
maintainers, who just prefer memset as it is unambiguous, doesn't
depend on a particular compiler version, and properly initializes all
subobjects [1][2]. Do that here so there are no more warnings.
[1]: https://lore.kernel.org/lkml/022e41c0-8465-dc7a-a45c-64187ecd9684@amd.com/
[2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.davem@davemloft.net/
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
amd-rng.c | ||
atmel-rng.c | ||
bcm2835-rng.c | ||
cavium-rng-vf.c | ||
cavium-rng.c | ||
core.c | ||
exynos-trng.c | ||
geode-rng.c | ||
hisi-rng.c | ||
imx-rngc.c | ||
intel-rng.c | ||
iproc-rng200.c | ||
ixp4xx-rng.c | ||
ks-sa-rng.c | ||
meson-rng.c | ||
mtk-rng.c | ||
mxc-rnga.c | ||
n2-asm.S | ||
n2-drv.c | ||
n2rng.h | ||
nomadik-rng.c | ||
octeon-rng.c | ||
omap-rng.c | ||
omap3-rom-rng.c | ||
optee-rng.c | ||
pasemi-rng.c | ||
pic32-rng.c | ||
powernv-rng.c | ||
pseries-rng.c | ||
s390-trng.c | ||
st-rng.c | ||
stm32-rng.c | ||
timeriomem-rng.c | ||
tx4939-rng.c | ||
via-rng.c | ||
virtio-rng.c | ||
xgene-rng.c |