summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/optee-rng.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/hw_random/optee-rng.c')
-rw-r--r--drivers/char/hw_random/optee-rng.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
index 2b9fc8ac5500..ddfbabaa5f8f 100644
--- a/drivers/char/hw_random/optee-rng.c
+++ b/drivers/char/hw_random/optee-rng.c
@@ -73,11 +73,14 @@ struct optee_rng_private {
static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,
void *buf, size_t req_size)
{
- u32 ret = 0;
+ int ret = 0;
u8 *rng_data = NULL;
size_t rng_size = 0;
- struct tee_ioctl_invoke_arg inv_arg = {0};
- struct tee_param param[4] = {0};
+ struct tee_ioctl_invoke_arg inv_arg;
+ struct tee_param param[4];
+
+ memset(&inv_arg, 0, sizeof(inv_arg));
+ memset(&param, 0, sizeof(param));
/* Invoke TA_CMD_GET_ENTROPY function of Trusted App */
inv_arg.func = TA_CMD_GET_ENTROPY;
@@ -172,9 +175,12 @@ static struct optee_rng_private pvt_data = {
static int get_optee_rng_info(struct device *dev)
{
- u32 ret = 0;
- struct tee_ioctl_invoke_arg inv_arg = {0};
- struct tee_param param[4] = {0};
+ int ret = 0;
+ struct tee_ioctl_invoke_arg inv_arg;
+ struct tee_param param[4];
+
+ memset(&inv_arg, 0, sizeof(inv_arg));
+ memset(&param, 0, sizeof(param));
/* Invoke TA_CMD_GET_RNG_INFO function of Trusted App */
inv_arg.func = TA_CMD_GET_RNG_INFO;
@@ -209,7 +215,9 @@ static int optee_rng_probe(struct device *dev)
{
struct tee_client_device *rng_device = to_tee_client_device(dev);
int ret = 0, err = -ENODEV;
- struct tee_ioctl_open_session_arg sess_arg = {0};
+ struct tee_ioctl_open_session_arg sess_arg;
+
+ memset(&sess_arg, 0, sizeof(sess_arg));
/* Open context with TEE driver */
pvt_data.ctx = tee_client_open_context(NULL, optee_ctx_match, NULL,
@@ -262,7 +270,7 @@ static int optee_rng_remove(struct device *dev)
return 0;
}
-const struct tee_client_device_id optee_rng_id_table[] = {
+static const struct tee_client_device_id optee_rng_id_table[] = {
{UUID_INIT(0xab7a617c, 0xb8e7, 0x4d8f,
0x83, 0x01, 0xd0, 0x9b, 0x61, 0x03, 0x6b, 0x64)},
{}
OpenPOWER on IntegriCloud