aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ktime.h7
-rw-r--r--include/linux/time64.h1
-rw-r--r--include/linux/timekeeping.h2
3 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 2b6a204bd8d4..3ffc69ebe967 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -64,6 +64,13 @@ static inline ktime_t ktime_set(const s64 secs, const unsigned long nsecs)
64 ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; }) 64 ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; })
65 65
66/* 66/*
67 * Same as ktime_add(), but avoids undefined behaviour on overflow; however,
68 * this means that you must check the result for overflow yourself.
69 */
70#define ktime_add_unsafe(lhs, rhs) \
71 ({ (ktime_t){ .tv64 = (u64) (lhs).tv64 + (rhs).tv64 }; })
72
73/*
67 * Add a ktime_t variable and a scalar nanosecond value. 74 * Add a ktime_t variable and a scalar nanosecond value.
68 * res = kt + nsval: 75 * res = kt + nsval:
69 */ 76 */
diff --git a/include/linux/time64.h b/include/linux/time64.h
index 7e5d2fa9ac46..980c71b3001a 100644
--- a/include/linux/time64.h
+++ b/include/linux/time64.h
@@ -5,6 +5,7 @@
5#include <linux/math64.h> 5#include <linux/math64.h>
6 6
7typedef __s64 time64_t; 7typedef __s64 time64_t;
8typedef __u64 timeu64_t;
8 9
9/* 10/*
10 * This wants to go into uapi/linux/time.h once we agreed about the 11 * This wants to go into uapi/linux/time.h once we agreed about the
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h
index 816b7543f81b..09168c52ab64 100644
--- a/include/linux/timekeeping.h
+++ b/include/linux/timekeeping.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_TIMEKEEPING_H 1#ifndef _LINUX_TIMEKEEPING_H
2#define _LINUX_TIMEKEEPING_H 2#define _LINUX_TIMEKEEPING_H
3 3
4#include <asm-generic/errno-base.h> 4#include <linux/errno.h>
5 5
6/* Included from linux/ktime.h */ 6/* Included from linux/ktime.h */
7 7