Lines Matching defs:kt
110 * res = kt + nsval:
112 #define ktime_add_ns(kt, nsval) \
113 ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
117 * res = kt - nsval:
119 #define ktime_sub_ns(kt, nsval) \
120 ({ (ktime_t){ .tv64 = (kt).tv64 - (nsval) }; })
135 #define ktime_to_timespec(kt) ns_to_timespec((kt).tv64)
138 #define ktime_to_timeval(kt) ns_to_timeval((kt).tv64)
141 #define ktime_to_ns(kt) ((kt).tv64)
212 * @kt: addend
215 * Returns the sum of @kt and @nsec in ktime_t format
217 extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
221 * @kt: minuend
224 * Returns the subtraction of @nsec from @kt in ktime_t format
226 extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
255 * @kt: the ktime_t variable to convert
259 static inline struct timespec ktime_to_timespec(const ktime_t kt)
261 return (struct timespec) { .tv_sec = (time_t) kt.tv.sec,
262 .tv_nsec = (long) kt.tv.nsec };
267 * @kt: the ktime_t variable to convert
271 static inline struct timeval ktime_to_timeval(const ktime_t kt)
274 .tv_sec = (time_t) kt.tv.sec,
275 .tv_usec = (suseconds_t) (kt.tv.nsec / NSEC_PER_USEC) };
280 * @kt: the ktime_t variable to convert
282 * Returns the scalar nanoseconds representation of @kt
284 static inline s64 ktime_to_ns(const ktime_t kt)
286 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
294 ktime_t kt;
296 kt = timespec_to_ktime(ts);
297 return (ktime_to_ns(kt));