mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwrng: stm32 - drop redundant initializations
@ 2026-10-02 14:35 Thorsten Blum
  2026-10-08  8:33 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-10-02 14:35 UTC (permalink / raw)
  To: Olivia Mackall, Herbert Xu, Maxime Coquelin, Alexandre Torgue,
	Can Peng, Linus Walleij
  Cc: Thorsten Blum, linux-crypto, linux-stm32, linux-arm-kernel, linux-kernel

The variables are reassigned before their initial values are read - drop
the redundant initializations.

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 drivers/char/hw_random/stm32-rng.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c
index f5bfe54c01dc..d3fc910f674a 100644
--- a/drivers/char/hw_random/stm32-rng.c
+++ b/drivers/char/hw_random/stm32-rng.c
@@ -156,7 +156,7 @@ static int stm32_rng_conceal_seed_error_cond_reset(struct stm32_rng_private *pri
  */
 static int stm32_rng_conceal_seed_error_sw_reset(struct stm32_rng_private *priv)
 {
-	unsigned int i = 0;
+	unsigned int i;
 	u32 sr = readl_relaxed(priv->base + RNG_SR);
 
 	writel_relaxed(sr & ~RNG_SR_SEIS, priv->base + RNG_SR);
@@ -187,7 +187,7 @@ static int stm32_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
 {
 	struct stm32_rng_private *priv = container_of(rng, struct stm32_rng_private, rng);
 	unsigned int i = 0;
-	int retval = 0, err = 0;
+	int retval, err;
 	u32 sr;
 
 	retval = pm_runtime_resume_and_get(priv->dev);
@@ -264,7 +264,7 @@ static uint stm32_rng_clock_freq_restrain(struct hwrng *rng)
 {
 	struct stm32_rng_private *priv =
 	    container_of(rng, struct stm32_rng_private, rng);
-	unsigned long clock_rate = 0;
+	unsigned long clock_rate;
 	uint clock_div = 0;
 
 	clock_rate = clk_get_rate(priv->clk_bulk[0].clk);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] hwrng: stm32 - drop redundant initializations
  2026-10-02 14:35 [PATCH] hwrng: stm32 - drop redundant initializations Thorsten Blum
@ 2026-10-08  8:33 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-10-08  8:33 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Olivia Mackall, Maxime Coquelin, Alexandre Torgue, Can Peng,
	Linus Walleij, linux-crypto, linux-stm32, linux-arm-kernel,
	linux-kernel

On Fri, Oct 02, 2026 at 04:35:53PM +0200, Thorsten Blum wrote:
> The variables are reassigned before their initial values are read - drop
> the redundant initializations.
> 
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
>  drivers/char/hw_random/stm32-rng.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-08  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-02 14:35 [PATCH] hwrng: stm32 - drop redundant initializations Thorsten Blum
2026-10-08  8:33 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®