* [PATCH] hwrng: Use us_to_ktime() where appropriate
@ 2025-07-31 12:17 Xichao Zhao
2025-08-16 9:34 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Xichao Zhao @ 2025-07-31 12:17 UTC (permalink / raw)
To: olivia, herbert; +Cc: linux-crypto, linux-kernel, Xichao Zhao
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>
---
drivers/char/hw_random/timeriomem-rng.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c
index b95f6d0f17ed..e61f06393209 100644
--- a/drivers/char/hw_random/timeriomem-rng.c
+++ b/drivers/char/hw_random/timeriomem-rng.c
@@ -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);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwrng: Use us_to_ktime() where appropriate
2025-07-31 12:17 [PATCH] hwrng: Use us_to_ktime() where appropriate Xichao Zhao
@ 2025-08-16 9:34 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2025-08-16 9:34 UTC (permalink / raw)
To: Xichao Zhao; +Cc: olivia, linux-crypto, linux-kernel
On Thu, Jul 31, 2025 at 08:17:27PM +0800, Xichao Zhao wrote:
> 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>
> ---
> drivers/char/hw_random/timeriomem-rng.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
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:[~2025-08-16 9:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31 12:17 [PATCH] hwrng: Use us_to_ktime() where appropriate Xichao Zhao
2025-08-16 9:34 ` Herbert Xu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).