Re: [PATCH v9 4/8] rust: time: Introduce Instant type

From: Gary Guo
Date: Sun Jan 26 2025 - 22:31:28 EST


On Sat, 25 Jan 2025 19:18:49 +0900
FUJITA Tomonori <fujita.tomonori@xxxxxxxxx> wrote:

> Introduce a type representing a specific point in time. We could use
> the Ktime type but C's ktime_t is used for both timestamp and
> timedelta. To avoid confusion, introduce a new Instant type for
> timestamp.
>
> Rename Ktime to Instant and modify their methods for timestamp.
>
> Implement the subtraction operator for Instant:
>
> Delta = Instant A - Instant B
>
> Reviewed-by: Boqun Feng <boqun.feng@xxxxxxxxx>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@xxxxxxxxx>

Reviewed-by: Gary Guo <gary@xxxxxxxxxxx>

> ---
> rust/kernel/time.rs | 77 +++++++++++++++++++++++----------------------
> 1 file changed, 39 insertions(+), 38 deletions(-)