lkml.org 
[lkml]   [2024]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] rust: time: add Ktime
Date
On Wed, Mar 20 2024 at 10:08, Alice Ryhl wrote:
> +impl Ktime {
> + /// Create a `Ktime` from a raw `ktime_t`.
> + #[inline]
> + pub fn from_raw(inner: bindings::ktime_t) -> Self {
> + Self { inner }
> + }
> +
> + /// Get the current time using `CLOCK_MONOTONIC`.
> + #[inline]
> + pub fn ktime_get() -> Self {
> + // SAFETY: It is always safe to call `ktime_get`.

That's not entirely correct. ktime_get() cannot be safely invoked from
NMI context. That won't matter for driver writers obviously.

Looks sensible otherwise.

Thanks,

tglx

\
 
 \ /
  Last update: 2024-05-27 15:56    [W:0.116 / U:1.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site