hwrng: optee - remove redundant initialization to variable rng_size
authorColin Ian King <colin.i.king@gmail.com>
Sun, 24 Apr 2022 18:11:56 +0000 (19:11 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 29 Apr 2022 05:44:58 +0000 (13:44 +0800)
Variable rng_size is being initialized with a value that is never read,
the variable is being re-assigned later on. The initialization is
redundant and can be removed.

Cleans up cppcheck warning:
Variable 'rng_size' is assigned a value that is never used.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/optee-rng.c

index a948c07..96b5d54 100644 (file)
@@ -115,7 +115,7 @@ static size_t get_optee_rng_data(struct optee_rng_private *pvt_data,
 static int optee_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
 {
        struct optee_rng_private *pvt_data = to_optee_rng_private(rng);
-       size_t read = 0, rng_size = 0;
+       size_t read = 0, rng_size;
        int timeout = 1;
        u8 *data = buf;