Skip to contentSkip to conversation

hwrng: stm32 - reuse clock rate in stm32_rng_clock_freq_restrain()

PATCH In review Thorsten Blum 3 participants 3 messages Oct 1 – Oct 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwrng: stm32 - reuse clock rate in stm32_rng_clock_freq_restrain()

Reuse clock_rate and avoid calling clk_get_rate() again. Remove the extra space before the colon while at it.

---
 drivers/char/hw_random/stm32-rng.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hw_random/stm32-rng.c +1 -1
index d3fc910f674a..319944d92b82 100644
@@ -277,7 +277,7 @@ static uint stm32_rng_clock_freq_restrain(struct hwrng *rng)
 	while ((clock_rate >> clock_div) > priv->data->max_clock_rate)
 		clock_div++;
 
-	pr_debug("RNG clk rate : %lu\n", clk_get_rate(priv->clk_bulk[0].clk) >> clock_div);
+	pr_debug("RNG clk rate: %lu\n", clock_rate >> clock_div);
 
 	return clock_div;
 }
Acked-by on v1 1/1
#1 lore raw
Quoted 22 lines · Thorsten Blum

Reuse clock_rate and avoid calling clk_get_rate() again. Remove the extra space before the colon while at it.

---
  drivers/char/hw_random/stm32-rng.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/hw_random/stm32-rng.c +1 -1
index d3fc910f674a..319944d92b82 100644
@@ -277,7 +277,7 @@ static uint stm32_rng_clock_freq_restrain(struct hwrng *rng)
  	while ((clock_rate >> clock_div) > priv->data->max_clock_rate)
  		clock_div++;
 
-	pr_debug("RNG clk rate : %lu\n", clk_get_rate(priv->clk_bulk[0].clk) >> clock_div);
+	pr_debug("RNG clk rate: %lu\n", clock_rate >> clock_div);
 
  	return clock_div;
  }
maintainer
#2 lore raw
In reply to Thorsten Blum
Quoted 7 lines · Thorsten Blum

Reuse clock_rate and avoid calling clk_get_rate() again. Remove the extra space before the colon while at it.

---
 drivers/char/hw_random/stm32-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