y2038: itimer: compat handling to itimer.c
The structure is only used in one place, moving it there simplifies the interface and helps with later changes to this code. Rename it to match the other time32 structures in the process. Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
@@ -90,30 +90,6 @@ int compat_put_timespec(const struct timespec *ts, void __user *uts)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(compat_put_timespec);
|
||||
|
||||
int get_compat_itimerval(struct itimerval *o, const struct compat_itimerval __user *i)
|
||||
{
|
||||
struct compat_itimerval v32;
|
||||
|
||||
if (copy_from_user(&v32, i, sizeof(struct compat_itimerval)))
|
||||
return -EFAULT;
|
||||
o->it_interval.tv_sec = v32.it_interval.tv_sec;
|
||||
o->it_interval.tv_usec = v32.it_interval.tv_usec;
|
||||
o->it_value.tv_sec = v32.it_value.tv_sec;
|
||||
o->it_value.tv_usec = v32.it_value.tv_usec;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int put_compat_itimerval(struct compat_itimerval __user *o, const struct itimerval *i)
|
||||
{
|
||||
struct compat_itimerval v32;
|
||||
|
||||
v32.it_interval.tv_sec = i->it_interval.tv_sec;
|
||||
v32.it_interval.tv_usec = i->it_interval.tv_usec;
|
||||
v32.it_value.tv_sec = i->it_value.tv_sec;
|
||||
v32.it_value.tv_usec = i->it_value.tv_usec;
|
||||
return copy_to_user(o, &v32, sizeof(struct compat_itimerval)) ? -EFAULT : 0;
|
||||
}
|
||||
|
||||
#ifdef __ARCH_WANT_SYS_SIGPROCMASK
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user