diff options
author | Dave Airlie <airlied@redhat.com> | 2020-03-11 07:27:21 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-03-11 07:27:21 +1000 |
commit | d3bd37f587b4438d47751d0f1d5aaae3d39bd416 (patch) | |
tree | 9414a8fd1ca74c47fe1a3966e0a22469ac0b73a3 /kernel/time/time.c | |
parent | 60347451ddb0646c1a9cc5b9581e5bcf648ad1aa (diff) | |
parent | 2c523b344dfa65a3738e7039832044aa133c75fb (diff) | |
download | linux-d3bd37f587b4438d47751d0f1d5aaae3d39bd416.tar.bz2 |
Merge v5.6-rc5 into drm-next
Requested my mripard for some misc patches that need this as a base.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'kernel/time/time.c')
-rw-r--r-- | kernel/time/time.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/kernel/time/time.c b/kernel/time/time.c index cdd7386115ff..3985b2b32d08 100644 --- a/kernel/time/time.c +++ b/kernel/time/time.c @@ -449,49 +449,6 @@ time64_t mktime64(const unsigned int year0, const unsigned int mon0, } EXPORT_SYMBOL(mktime64); -/** - * ns_to_timespec - Convert nanoseconds to timespec - * @nsec: the nanoseconds value to be converted - * - * Returns the timespec representation of the nsec parameter. - */ -struct timespec ns_to_timespec(const s64 nsec) -{ - struct timespec ts; - s32 rem; - - if (!nsec) - return (struct timespec) {0, 0}; - - ts.tv_sec = div_s64_rem(nsec, NSEC_PER_SEC, &rem); - if (unlikely(rem < 0)) { - ts.tv_sec--; - rem += NSEC_PER_SEC; - } - ts.tv_nsec = rem; - - return ts; -} -EXPORT_SYMBOL(ns_to_timespec); - -/** - * ns_to_timeval - Convert nanoseconds to timeval - * @nsec: the nanoseconds value to be converted - * - * Returns the timeval representation of the nsec parameter. - */ -struct timeval ns_to_timeval(const s64 nsec) -{ - struct timespec ts = ns_to_timespec(nsec); - struct timeval tv; - - tv.tv_sec = ts.tv_sec; - tv.tv_usec = (suseconds_t) ts.tv_nsec / 1000; - - return tv; -} -EXPORT_SYMBOL(ns_to_timeval); - struct __kernel_old_timeval ns_to_kernel_old_timeval(const s64 nsec) { struct timespec64 ts = ns_to_timespec64(nsec); |