Rust for Linux List
 help / color / mirror / Atom feed
From: Fiona Behrens <me@kloenk.dev>
To: FUJITA Tomonori <fujita.tomonori@gmail.com>
Cc: linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Alice Ryhl <aliceryhl@google.com>,
	rust-for-linux@vger.kernel.org, netdev@vger.kernel.org,
	hkallweit1@gmail.com, tmgross@umich.edu, ojeda@kernel.org,
	alex.gaynor@gmail.com, gary@garyguo.net,
	bjorn3_gh@protonmail.com, benno.lossin@proton.me,
	a.hindborg@samsung.com, anna-maria@linutronix.de,
	frederic@kernel.org, tglx@linutronix.de, arnd@arndb.de,
	jstultz@google.com, sboyd@kernel.org, mingo@redhat.com,
	peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, tgunders@redhat.com
Subject: Re: [PATCH v9 3/8] rust: time: Introduce Delta type
Date: Tue, 28 Jan 2025 11:25:48 +0100	[thread overview]
Message-ID: <C8EE4BA7-2DCC-413B-9183-2F7C0D890544@kloenk.dev> (raw)
In-Reply-To: <20250125101854.112261-4-fujita.tomonori@gmail.com>



On 25 Jan 2025, at 11:18, FUJITA Tomonori wrote:

> 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.

Thanks for adding millis, also will use that in my led patch :)

>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> Reviewed-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Reviewed-by: Fiona Behrens <me@kloenk.dev>

  parent reply	other threads:[~2025-01-28 10:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-25 10:18 [PATCH v9 0/8] rust: Add IO polling FUJITA Tomonori
2025-01-25 10:18 ` [PATCH v9 1/8] sched/core: Add __might_sleep_precision() FUJITA Tomonori
2025-01-27  9:41   ` Alice Ryhl
2025-01-28 11:37   ` Peter Zijlstra
2025-01-29 23:56     ` FUJITA Tomonori
2025-01-30  1:14       ` Boqun Feng
2025-02-01 12:16         ` Peter Zijlstra
2025-01-25 10:18 ` [PATCH v9 2/8] rust: time: Add PartialEq/Eq/PartialOrd/Ord trait to Ktime FUJITA Tomonori
2025-01-28 10:18   ` Fiona Behrens
2025-01-25 10:18 ` [PATCH v9 3/8] rust: time: Introduce Delta type FUJITA Tomonori
2025-01-27  3:24   ` Gary Guo
2025-01-28 10:25   ` Fiona Behrens [this message]
2025-01-25 10:18 ` [PATCH v9 4/8] rust: time: Introduce Instant type FUJITA Tomonori
2025-01-27  3:30   ` Gary Guo
2025-01-28 10:30   ` Fiona Behrens
2025-01-25 10:18 ` [PATCH v9 5/8] rust: time: Add wrapper for fsleep() function FUJITA Tomonori
2025-01-27  3:41   ` Gary Guo
2025-01-27  8:55   ` Alice Ryhl
2025-01-28 10:37   ` Fiona Behrens
2025-01-29  5:04     ` FUJITA Tomonori
2025-01-25 10:18 ` [PATCH v9 6/8] MAINTAINERS: rust: Add TIMEKEEPING and TIMER abstractions FUJITA Tomonori
2025-01-25 10:18 ` [PATCH v9 7/8] rust: Add read_poll_timeout functions FUJITA Tomonori
2025-01-27  3:46   ` Gary Guo
2025-01-27  6:31     ` FUJITA Tomonori
2025-01-28  0:49       ` Gary Guo
2025-01-28  6:29         ` FUJITA Tomonori
2025-01-28 10:49           ` Fiona Behrens
2025-01-29  4:53             ` FUJITA Tomonori
2025-01-29  6:31           ` FUJITA Tomonori
2025-01-28 10:52   ` Fiona Behrens
2025-01-29  4:40     ` FUJITA Tomonori
2025-01-25 10:18 ` [PATCH v9 8/8] net: phy: qt2025: Wait until PHY becomes ready FUJITA Tomonori

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=C8EE4BA7-2DCC-413B-9183-2F7C0D890544@kloenk.dev \
    --to=me@kloenk.dev \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=andrew@lunn.ch \
    --cc=anna-maria@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=frederic@kernel.org \
    --cc=fujita.tomonori@gmail.com \
    --cc=gary@garyguo.net \
    --cc=hkallweit1@gmail.com \
    --cc=jstultz@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tgunders@redhat.com \
    --cc=tmgross@umich.edu \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox