y2038: remove unused time32 interfaces
No users remain, so kill these off before we grow new ones. Link: http://lkml.kernel.org/r/20200110154232.4104492-3-arnd@arndb.de Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: Deepa Dinamani <deepa.kernel@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Цей коміт міститься в:

зафіксовано
Linus Torvalds

джерело
595abbaff5
коміт
412c53a680
@@ -26,70 +26,6 @@
|
||||
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
static int __compat_get_timeval(struct timeval *tv, const struct old_timeval32 __user *ctv)
|
||||
{
|
||||
return (!access_ok(ctv, sizeof(*ctv)) ||
|
||||
__get_user(tv->tv_sec, &ctv->tv_sec) ||
|
||||
__get_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
static int __compat_put_timeval(const struct timeval *tv, struct old_timeval32 __user *ctv)
|
||||
{
|
||||
return (!access_ok(ctv, sizeof(*ctv)) ||
|
||||
__put_user(tv->tv_sec, &ctv->tv_sec) ||
|
||||
__put_user(tv->tv_usec, &ctv->tv_usec)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
static int __compat_get_timespec(struct timespec *ts, const struct old_timespec32 __user *cts)
|
||||
{
|
||||
return (!access_ok(cts, sizeof(*cts)) ||
|
||||
__get_user(ts->tv_sec, &cts->tv_sec) ||
|
||||
__get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
static int __compat_put_timespec(const struct timespec *ts, struct old_timespec32 __user *cts)
|
||||
{
|
||||
return (!access_ok(cts, sizeof(*cts)) ||
|
||||
__put_user(ts->tv_sec, &cts->tv_sec) ||
|
||||
__put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
int compat_get_timeval(struct timeval *tv, const void __user *utv)
|
||||
{
|
||||
if (COMPAT_USE_64BIT_TIME)
|
||||
return copy_from_user(tv, utv, sizeof(*tv)) ? -EFAULT : 0;
|
||||
else
|
||||
return __compat_get_timeval(tv, utv);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(compat_get_timeval);
|
||||
|
||||
int compat_put_timeval(const struct timeval *tv, void __user *utv)
|
||||
{
|
||||
if (COMPAT_USE_64BIT_TIME)
|
||||
return copy_to_user(utv, tv, sizeof(*tv)) ? -EFAULT : 0;
|
||||
else
|
||||
return __compat_put_timeval(tv, utv);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(compat_put_timeval);
|
||||
|
||||
int compat_get_timespec(struct timespec *ts, const void __user *uts)
|
||||
{
|
||||
if (COMPAT_USE_64BIT_TIME)
|
||||
return copy_from_user(ts, uts, sizeof(*ts)) ? -EFAULT : 0;
|
||||
else
|
||||
return __compat_get_timespec(ts, uts);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(compat_get_timespec);
|
||||
|
||||
int compat_put_timespec(const struct timespec *ts, void __user *uts)
|
||||
{
|
||||
if (COMPAT_USE_64BIT_TIME)
|
||||
return copy_to_user(uts, ts, sizeof(*ts)) ? -EFAULT : 0;
|
||||
else
|
||||
return __compat_put_timespec(ts, uts);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(compat_put_timespec);
|
||||
|
||||
#ifdef __ARCH_WANT_SYS_SIGPROCMASK
|
||||
|
||||
/*
|
||||
|
@@ -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);
|
||||
|
Посилання в новій задачі
Заблокувати користувача