Re: [PATCH v6 2/7] rust: time: add jiffies time unit for Delta

Andreas Hindborg <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
FUJITA Tomonori <[email protected]> writes:

> From: FUJITA Tomonori <[email protected]>
>
> Add a Jiffy time unit with isize as its representation and provide
> Delta<Jiffy>::from_jiffies() and as_jiffies() as the unit-specific
> constructor and accessor, mirroring from_nanos()/as_nanos() on the
> nanosecond Delta.
>
> Represent the jiffies span as isize: Delta is a signed span (nanoseconds
> use i64) and, as a timeout, the value only needs to reach
> MAX_JIFFY_OFFSET ((LONG_MAX >> 1) - 1). isize is signed and matches the
> kernel's c_long, so it meets both.
>
> Reviewed-by: Gary Guo <[email protected]>
> Signed-off-by: FUJITA Tomonori <[email protected]>

Reviewed-by: Andreas Hindborg <[email protected]>

Best regards,
Andreas Hindborg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.