]> Pileus Git - ~andy/linux/blobdiff - include/linux/time.h
time: Move ktime_t overflow checking into timespec_valid_strict
[~andy/linux] / include / linux / time.h
index b0bbd8f0130d52305d2ee945824327011f269e01..b51e664c83e7237e17e02f0b5752ce586f87dbd4 100644 (file)
@@ -125,6 +125,13 @@ static inline bool timespec_valid(const struct timespec *ts)
        /* Can't have more nanoseconds then a second */
        if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC)
                return false;
+       return true;
+}
+
+static inline bool timespec_valid_strict(const struct timespec *ts)
+{
+       if (!timespec_valid(ts))
+               return false;
        /* Disallow values that could overflow ktime_t */
        if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX)
                return false;