ktime: Add us_to_ktime()

Add a us_to_ktime() helper to go with ms_to_ktime() and ns_to_ktime().

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Thomas Gleixner <tglx@linutronix.de>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20241204074710.990092-2-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
David Howells 2024-12-04 07:46:29 +00:00 committed by Jakub Kicinski
parent 6145fefc1e
commit d1fd972914

View File

@ -222,6 +222,11 @@ static inline ktime_t ns_to_ktime(u64 ns)
return ns;
}
static inline ktime_t us_to_ktime(u64 us)
{
return us * NSEC_PER_USEC;
}
static inline ktime_t ms_to_ktime(u64 ms)
{
return ms * NSEC_PER_MSEC;