[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFA6WYMeOv160_mnEHVN9GgN1tqN9Zt0GqnGQRgP4m8V-aztTQ@mail.gmail.com>
Date: Mon, 25 Apr 2022 11:22:19 +0530
From: Sumit Garg <sumit.garg@...aro.org>
To: Colin Ian King <colin.i.king@...il.com>
Cc: Matt Mackall <mpm@...enic.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
op-tee@...ts.trustedfirmware.org, linux-crypto@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwrng: optee-rng: remove redundant initialization to
variable rng_size
On Sun, 24 Apr 2022 at 23:41, Colin Ian King <colin.i.king@...il.com> wrote:
>
> 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@...il.com>
> ---
> drivers/char/hw_random/optee-rng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Sumit Garg <sumit.garg@...aro.org>
-Sumit
> diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c
> index a948c0727b2b..96b5d546d136 100644
> --- a/drivers/char/hw_random/optee-rng.c
> +++ b/drivers/char/hw_random/optee-rng.c
> @@ -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
>
Powered by blists - more mailing lists