]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
rust: time: Remove Ktime in hrtimer
authorFUJITA Tomonori <fujita.tomonori@gmail.com>
Tue, 10 Jun 2025 13:28:23 +0000 (22:28 +0900)
committerAndreas Hindborg <a.hindborg@kernel.org>
Tue, 24 Jun 2025 17:52:47 +0000 (19:52 +0200)
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: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Link: https://lore.kernel.org/r/20250610132823.3457263-6-fujita.tomonori@gmail.com
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
rust/kernel/time/hrtimer.rs

index 8b15eb374db0106807c4f3d6df7c53bcb48c67c3..1b81bf306d16688054733902a0aa4be32bcb828e 100644 (file)
@@ -72,22 +72,6 @@ use crate::{prelude::*, types::Opaque};
 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