]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rust: time: Replace ClockId enum with ClockSource trait
authorFUJITA Tomonori <fujita.tomonori@gmail.com>
Tue, 10 Jun 2025 09:32:54 +0000 (18:32 +0900)
committerAndreas Hindborg <a.hindborg@kernel.org>
Mon, 16 Jun 2025 13:01:37 +0000 (15:01 +0200)
commit1664a671be46a0b0daf5250eb124d94a5501a64c
tree25bb29707b46024c185ca5ad2a4d5db4fe2325b1
parent1b7bbd5975279a1cf8d907fbc719f350031194c2
rust: time: Replace ClockId enum with ClockSource trait

Replace the ClockId enum with a trait-based abstraction called
ClockSource. This change enables expressing clock sources as types and
leveraging the Rust type system to enforce clock correctness at
compile time.

This also sets the stage for future generic abstractions over Instant
types such as Instant<C>.

Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Link: https://lore.kernel.org/r/20250610093258.3435874-2-fujita.tomonori@gmail.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
rust/kernel/time.rs
rust/kernel/time/hrtimer.rs