Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH v1 0/2] rust: time: seconds based Instant
@ 2026-10-31  0:33 FUJITA Tomonori
  2026-10-31  0:33 ` [PATCH v1 1/2] rust: time: make Instant generic over the time unit FUJITA Tomonori
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: FUJITA Tomonori @ 2026-10-31  0:33 UTC (permalink / raw)
  To: a.hindborg, boqun, ojeda
  Cc: acourbot, aliceryhl, anna-maria, bjorn3_gh, dakr, daniel.almeida,
	frederic, gary, jstultz, lossin, lyude, mike, sboyd, tamird, tglx,
	tmgross, work, rust-for-linux, FUJITA Tomonori

From: FUJITA Tomonori <fujita.tomonori@gmail.com>

Mike's series added a free function `ktime_get_real_seconds()` [1].
Andreas and Boqun preferred a seconds based `Instant` instead. This
series does that.

1/2 adds a unit type parameter to `Instant`, with no functional change.
2/2 adds the `Sec` unit and `ClockId::ktime_get_seconds()`.
`Instant<C, Sec>` has only `now()` and `as_secs()`; there is no
`Delta<Sec>`.

The `now()` doc comment in 1/2 changes the same line as [2]. Whichever
is applied first, the other conflicts on that one line only.

Based on rust-next.

[1] https://lore.kernel.org/rust-for-linux/20260826162851.2497-10-mike@fireburn.co.uk/
[2] https://lore.kernel.org/rust-for-linux/20261030044803.3863267-1-tomo@flapping.org/

FUJITA Tomonori (2):
  rust: time: make Instant generic over the time unit
  rust: time: add Instant in seconds

 rust/helpers/time.c |  10 ++++
 rust/kernel/time.rs | 123 +++++++++++++++++++++++++++++++++++++-------
 2 files changed, 115 insertions(+), 18 deletions(-)


base-commit: d89e1d186ec9271bf78e62771779e9fc03bf0fc3
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-31  3:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-31  0:33 [PATCH v1 0/2] rust: time: seconds based Instant FUJITA Tomonori
2026-10-31  0:33 ` [PATCH v1 1/2] rust: time: make Instant generic over the time unit FUJITA Tomonori
2026-10-31  0:33 ` [PATCH v1 2/2] rust: time: add Instant in seconds FUJITA Tomonori
2026-10-31  3:56 ` [PATCH v1 0/2] rust: time: seconds based Instant Boqun Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox