linux/drivers/tee/optee
Nathan Chancellor 50ceca6894 tee: optee: Initialize some structs using memset instead of braces
Clang warns:

drivers/tee/optee/device.c:39:31: warning: suggest braces around
initialization of subobject [-Wmissing-braces]
        struct tee_param param[4] = {0};
                                     ^
                                     {}
drivers/tee/optee/device.c:92:48: warning: suggest braces around
initialization of subobject [-Wmissing-braces]
        struct tee_ioctl_open_session_arg sess_arg = {0};
                                                      ^
                                                      {}
2 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: c3fa24af92 ("tee: optee: add TEE bus device enumeration support")
Link: https://github.com/ClangBuiltLinux/linux/issues/370
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2019-02-20 16:24:09 +01:00
..
call.c This pull request updates the previous tee-drv-dynamic-shm-for-v4.16 pull 2018-01-11 18:05:06 -08:00
core.c tee: optee: add TEE bus device enumeration support 2019-02-01 15:12:46 +01:00
device.c tee: optee: Initialize some structs using memset instead of braces 2019-02-20 16:24:09 +01:00
Kconfig tee: optee: making OPTEE_SHM_NUM_PRIV_PAGES configurable via Kconfig 2018-06-20 11:20:36 +02:00
Makefile tee: optee: add TEE bus device enumeration support 2019-02-01 15:12:46 +01:00
optee_msg.h tee: optee: Update protocol definitions 2017-12-15 13:32:31 +01:00
optee_private.h tee: optee: add TEE bus device enumeration support 2019-02-01 15:12:46 +01:00
optee_smc.h tee: optee: GET_OS_REVISION: document a2 as a build identifier 2018-03-06 11:03:55 +01:00
rpc.c tee: replace getnstimeofday64() with ktime_get_real_ts64() 2018-06-19 16:37:14 +02:00
shm_pool.c tee: optee: add optee-specific shared pool implementation 2017-12-15 13:36:17 +01:00
shm_pool.h tee: optee: add optee-specific shared pool implementation 2017-12-15 13:36:17 +01:00
supp.c tee: add supp_nowait flag in tee_context struct 2019-02-01 15:12:46 +01:00