]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ktime: Add us_to_ktime()
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Dec 2024 07:46:29 +0000 (07:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Mon, 9 Dec 2024 21:48:23 +0000 (13:48 -0800)
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>
include/linux/ktime.h

index 3a4e723eae0f1203d5aec7bb2d460dfbf171b644..383ed99858024838e6554c09644eb79a22eb4c34 100644 (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;