aboutsummaryrefslogtreecommitdiffstats
path: root/rust/pin-init/internal/src
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@gmail.com>2025-04-24 04:28:53 +0900
committerAndreas Hindborg <a.hindborg@kernel.org>2025-04-29 15:31:07 +0200
commitfae0cdc12340ce402a4681dba0f357b05d167d00 (patch)
tree7e4516afe047edfdad212f4f2cd31521eca554a3 /rust/pin-init/internal/src
parentrust: time: Add PartialEq/Eq/PartialOrd/Ord trait to Ktime (diff)
downloadlinux-rng-fae0cdc12340ce402a4681dba0f357b05d167d00.tar.xz
linux-rng-fae0cdc12340ce402a4681dba0f357b05d167d00.zip
rust: time: Introduce Delta type
Introduce a type representing a span of time. Define our own type because `core::time::Duration` is large and could panic during creation. time::Ktime could be also used for time duration but timestamp and timedelta are different so better to use a new type. i64 is used instead of u64 to represent a span of time; some C drivers uses negative Deltas and i64 is more compatible with Ktime using i64 too (e.g., ktime_[us|ms]_delta() APIs return i64 so we create Delta object without type conversion. i64 is used instead of bindings::ktime_t because when the ktime_t type is used as timestamp, it represents values from 0 to KTIME_MAX, which is different from Delta. as_millis() method isn't used in this patchset. It's planned to be used in Binder driver. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net> Reviewed-by: Fiona Behrens <me@kloenk.dev> Tested-by: Daniel Almeida <daniel.almeida@collabora.com> Reviewed-by: Andreas Hindborg <a.hindborg@kernel.org> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com> Link: https://lore.kernel.org/r/20250423192857.199712-4-fujita.tomonori@gmail.com Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Diffstat (limited to 'rust/pin-init/internal/src')
0 files changed, 0 insertions, 0 deletions