]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwrng: timeriomem - Use us_to_ktime() where appropriate
authorXichao Zhao <zhao.xichao@vivo.com>
Thu, 31 Jul 2025 12:17:27 +0000 (20:17 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 16 Aug 2025 09:24:31 +0000 (17:24 +0800)
It is better to replace ns_to_ktime() with us_to_ktime(),
which can make the code clearer.

Signed-off-by: Xichao Zhao <zhao.xichao@vivo.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/timeriomem-rng.c

index b95f6d0f17ede86d03f4cb0e6a36490aada8d78a..e61f063932090658595b1c1e186493dfc47c1eea 100644 (file)
@@ -150,7 +150,7 @@ static int timeriomem_rng_probe(struct platform_device *pdev)
                priv->rng_ops.quality = pdata->quality;
        }
 
-       priv->period = ns_to_ktime(period * NSEC_PER_USEC);
+       priv->period = us_to_ktime(period);
        init_completion(&priv->completion);
        hrtimer_setup(&priv->timer, timeriomem_rng_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);