[PATCH 1/3]: Inline for time delta

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[DCCP]: Inline for time delta

This provides a reusable time difference function which returns the difference in
microseconds, as often used in the DCCP code.

Signed-off-by: Gerrit Renker <gerrit@xxxxxxxxxxxxxx>
---
 net/dccp/dccp.h |    5 +++++
 1 file changed, 5 insertions(+)

--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -421,6 +421,11 @@ static inline suseconds_t timeval_delta(
 	return secs * USEC_PER_SEC + usecs;
 }
 
+static inline s64 ktime_delta(ktime_t later, ktime_t earlier)
+{
+	return ktime_to_us(ktime_sub(later, earlier));
+}
+
 static inline void timeval_add_usecs(struct timeval *tv,
 				     const suseconds_t usecs)
 {
-
To unsubscribe from this list: send the line "unsubscribe dccp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux