[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180611115218.GA23539@tejaswit-linux.qualcomm.com>
Date: Mon, 11 Jun 2018 17:22:28 +0530
From: Tejaswi Tanikella <tejaswit@...eaurora.org>
To: netdev@...r.kernel.org, f.fainelli@...il.com
Cc: andrew@...n.ch, davem@...emloft.net
Subject: [PATCH 2/2] ktime: helpers to convert between ktime and jiffies
Signed-off-by: Tejaswi Tanikella <tejaswit@...eaurora.org>
---
include/linux/ktime.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 5b9fddb..4881483 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -96,6 +96,10 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
#define ktime_to_ns(kt) (kt)
+/* ktime to jiffies and back */
+#define ktime_to_jiffies(kt) nsecs_to_jiffies(kt)
+#define jiffies_to_ktime(j) jiffies_to_nsecs(j)
+
/**
* ktime_compare - Compares two ktime_t variables for less, greater or equal
* @cmp1: comparable1
--
1.9.1
Powered by blists - more mailing lists