Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwrng: optee - remove redundant initialization to variable rng_size

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>

authored by

Colin Ian King and committed by
Herbert Xu
11aeb930 fd463e98

+1 -1
+1 -1
drivers/char/hw_random/optee-rng.c
··· 115 115 static int optee_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait) 116 116 { 117 117 struct optee_rng_private *pvt_data = to_optee_rng_private(rng); 118 - size_t read = 0, rng_size = 0; 118 + size_t read = 0, rng_size; 119 119 int timeout = 1; 120 120 u8 *data = buf; 121 121