]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rxrpc: Add ktime_sub_ms()
authorDavid Howells <dhowells@redhat.com>
Wed, 21 Sep 2016 23:29:01 +0000 (00:29 +0100)
committerDavid Howells <dhowells@redhat.com>
Thu, 22 Sep 2016 07:21:24 +0000 (08:21 +0100)
Add a ktime_sub_ms() to go with ktime_add_ms() and co. for use in AF_RXRPC
RTT determination.

Signed-off-by: David Howells <dhowells@redhat.com>
include/linux/ktime.h

index 2b6a204bd8d40cfb74db80e19bec216795366e33..aa118bad1407800b20a54e9d3f3e42fc88c77e32 100644 (file)
@@ -231,6 +231,11 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
        return ktime_sub_ns(kt, usec * NSEC_PER_USEC);
 }
 
+static inline ktime_t ktime_sub_ms(const ktime_t kt, const u64 msec)
+{
+       return ktime_sub_ns(kt, msec * NSEC_PER_MSEC);
+}
+
 extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
 
 /**