diff options
Diffstat (limited to 'include/linux/ktime.h')
-rw-r--r-- | include/linux/ktime.h | 7 |
1 files changed, 7 insertions, 0 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 | */ |