rust: time: Replace HrTimerMode enum with trait-based mode types
authorFUJITA Tomonori <fujita.tomonori@gmail.com>
Tue, 10 Jun 2025 13:28:20 +0000 (22:28 +0900)
committerAndreas Hindborg <a.hindborg@kernel.org>
Tue, 24 Jun 2025 13:12:19 +0000 (15:12 +0200)
commitced9ccd21fbc8ca941e6a0c2820c2df89239ccb9
tree67c647bd83e6a25fc43c279af2485fc5acddca44
parentcc6d1098b4cca6ec8e659de8361457c59a90b583
rust: time: Replace HrTimerMode enum with trait-based mode types

Replace the `HrTimerMode` enum with a trait-based approach that uses
zero-sized types to represent each mode of operation. Each mode now
implements the `HrTimerMode` trait.

This refactoring is a preparation for replacing raw `Ktime` in HrTimer
with the `Instant` and `Delta` types, and for making `HrTimer` generic
over a `ClockSource`.

Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Link: https://lore.kernel.org/r/20250610132823.3457263-3-fujita.tomonori@gmail.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
rust/kernel/time/hrtimer.rs