Re: [PATCH v1] rust: time: Avoid 64-bit integer division
From: Miguel Ojeda
Date: Thu May 01 2025 - 05:22:52 EST
On Thu, May 1, 2025 at 3:58 AM FUJITA Tomonori
<fujita.tomonori@xxxxxxxxx> wrote:
>
> +s64 rust_helper_ktime_to_us(const ktime_t kt)
> +{
> + return ktime_divns(kt, NSEC_PER_USEC);
> +}
> +
> +s64 rust_helper_ktime_to_ms(const ktime_t kt)
> +{
> + return ktime_divns(kt, NSEC_PER_MSEC);
> +}
In general, we want to keep helpers mapping to the functions as close
as possible to the C side (e.g. same arguments), unless there is a
good reason not to -- but since you are changing it, let's review
v2...
Cheers,
Miguel