hwrng: optee-rng: remove redundant initialization to variable rng_size
Subsystems (4)
PATCH 1/1 hwrng: optee-rng: 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.
--- drivers/char/hw_random/optee-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hw_random/optee-rng.c +1 -1
@@ -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;
Signature · 1 line
2.35.1
Quoted 5 lines · Colin Ian King
Variable
rng_sizeis 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.
Quoted 8 lines
Cleans up cppcheck warning:
Variable 'rng_size' is assigned a value that is never used.Signed-off-by Colin Ian King <[email protected]>--- drivers/char/hw_random/optee-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
-Sumit
Quoted 16 lines
drivers/char/hw_random/optee-rng.c +1
-2@@ -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; --2.35.1
Herbert Xu
maintainerQuoted 11 lines · Colin Ian King
Variable
rng_sizeis 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 <[email protected]>--- drivers/char/hw_random/optee-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt