Commit 69f66cf4 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Andreas Hindborg
Browse files

rust: time: Remove Ktime in hrtimer



Remove the use of `Ktime` from the hrtimer code, which was originally
introduced as a temporary workaround. The hrtimer has now been fully
converted to use the `Instant` and `Delta` types instead.

Reviewed-by: default avatarAndreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@gmail.com>
Link: https://lore.kernel.org/r/20250610132823.3457263-6-fujita.tomonori@gmail.com


Signed-off-by: default avatarAndreas Hindborg <a.hindborg@kernel.org>
parent e0c0ab04
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -72,22 +72,6 @@
use core::marker::PhantomData;
use pin_init::PinInit;

/// A Rust wrapper around a `ktime_t`.
// NOTE: Ktime is going to be removed when hrtimer is converted to Instant/Delta.
#[repr(transparent)]
#[derive(Copy, Clone, PartialEq, PartialOrd, Eq, Ord)]
pub struct Ktime {
    inner: bindings::ktime_t,
}

impl Ktime {
    /// Returns the number of nanoseconds.
    #[inline]
    pub fn to_ns(self) -> i64 {
        self.inner
    }
}

/// A timer backed by a C `struct hrtimer`.
///
/// # Invariants