From: Andreas Hindborg <a.hindborg@kernel.org>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>, lyude@redhat.com
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
boqun.feng@gmail.com, fujita.tomonori@gmail.com,
frederic@kernel.org, tglx@linutronix.de,
anna-maria@linutronix.de, jstultz@google.com, sboyd@kernel.org,
ojeda@kernel.org, alex.gaynor@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, lossin@kernel.org,
aliceryhl@google.com, tmgross@umich.edu, dakr@kernel.org
Subject: Re: [PATCH] rust/time: Add Delta::from_nanos()
Date: Thu, 19 Feb 2026 11:48:17 +0100 [thread overview]
Message-ID: <87wm099fgu.fsf@kernel.org> (raw)
In-Reply-To: <20251117.103923.1643210589533849785.fujita.tomonori@gmail.com>
FUJITA Tomonori <fujita.tomonori@gmail.com> writes:
> On Fri, 14 Nov 2025 13:42:06 -0500
> Lyude Paul <lyude@redhat.com> wrote:
>
>> Since rvkms is going to need to create its own Delta instances, and we
>> already have functions for creating Delta with every other unit of time.
>>
>> Signed-off-by: Lyude Paul <lyude@redhat.com>
>> ---
>> rust/kernel/time.rs | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/rust/kernel/time.rs b/rust/kernel/time.rs
>> index 6ea98dfcd0278..2b096e5a61cda 100644
>> --- a/rust/kernel/time.rs
>> +++ b/rust/kernel/time.rs
>> @@ -363,6 +363,12 @@ impl Delta {
>> /// A span of time equal to zero.
>> pub const ZERO: Self = Self { nanos: 0 };
>>
>> + /// Create a new [`Delta`] from a number of nanoseconds.
>> + #[inline]
>> + pub const fn from_nanos(nanos: i64) -> Self {
>> + Self { nanos }
>> + }
>> +
>> /// Create a new [`Delta`] from a number of microseconds.
>> ///
>> /// The `micros` can range from -9_223_372_036_854_775 to 9_223_372_036_854_775.
>
> For consistency with the other methods, perhaps we should also mention
> the valid nanos range in the comment?
On second thought, since valid range is any valid `i64` value, I don't
think this matters.
Best regards,
Andreas Hindborg
next prev parent reply other threads:[~2026-02-19 10:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 18:42 [PATCH] rust/time: Add Delta::from_nanos() Lyude Paul
2025-11-16 6:38 ` Onur Özkan
2025-11-16 11:06 ` Miguel Ojeda
2025-11-17 10:21 ` Onur Özkan
2025-11-17 1:39 ` FUJITA Tomonori
2025-11-17 11:15 ` Andreas Hindborg
2025-11-17 11:38 ` FUJITA Tomonori
2025-11-17 12:26 ` Andreas Hindborg
2026-02-19 10:48 ` Andreas Hindborg [this message]
2026-03-23 11:07 ` Andreas Hindborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wm099fgu.fsf@kernel.org \
--to=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=anna-maria@linutronix.de \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=frederic@kernel.org \
--cc=fujita.tomonori@gmail.com \
--cc=gary@garyguo.net \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=lyude@redhat.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=tglx@linutronix.de \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.