simplify compat_sys_timerfd
Just thought this is easier to read. Acked-by: Davide Libenzi <davidel@xmailserver.org> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d55e2ca873
commit
8317f14b60
13
fs/compat.c
13
fs/compat.c
|
@ -2230,21 +2230,16 @@ asmlinkage long compat_sys_signalfd(int ufd,
|
||||||
asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
|
asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
|
||||||
const struct compat_itimerspec __user *utmr)
|
const struct compat_itimerspec __user *utmr)
|
||||||
{
|
{
|
||||||
long res;
|
|
||||||
struct itimerspec t;
|
struct itimerspec t;
|
||||||
struct itimerspec __user *ut;
|
struct itimerspec __user *ut;
|
||||||
|
|
||||||
res = -EFAULT;
|
|
||||||
if (get_compat_itimerspec(&t, utmr))
|
if (get_compat_itimerspec(&t, utmr))
|
||||||
goto err_exit;
|
return -EFAULT;
|
||||||
ut = compat_alloc_user_space(sizeof(*ut));
|
ut = compat_alloc_user_space(sizeof(*ut));
|
||||||
if (copy_to_user(ut, &t, sizeof(t)) )
|
if (copy_to_user(ut, &t, sizeof(t)))
|
||||||
goto err_exit;
|
return -EFAULT;
|
||||||
|
|
||||||
res = sys_timerfd(ufd, clockid, flags, ut);
|
return sys_timerfd(ufd, clockid, flags, ut);
|
||||||
err_exit:
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_TIMERFD */
|
#endif /* CONFIG_TIMERFD */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue