net: use compat helper functions in compat_sys_recvmmsg
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 9 Dec 2009 20:59:15 +0000 (20:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Dec 2009 23:07:57 +0000 (15:07 -0800)
Use (get|put)_compat_timespec helper functions to simplify the code.

Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/compat.c

index c4d9131a5872a47d4d58155b3b0a2b5e6f11710e..a1fb1b079a82b00bd269fa208984de34010bf7f4 100644 (file)
@@ -763,15 +763,12 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg,
                return __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                      flags | MSG_CMSG_COMPAT, NULL);
 
-       if (get_user(ktspec.tv_sec, &timeout->tv_sec) ||
-           get_user(ktspec.tv_nsec, &timeout->tv_nsec))
+       if (get_compat_timespec(&ktspec, timeout))
                return -EFAULT;
 
        datagrams = __sys_recvmmsg(fd, (struct mmsghdr __user *)mmsg, vlen,
                                   flags | MSG_CMSG_COMPAT, &ktspec);
-       if (datagrams > 0 &&
-           (put_user(ktspec.tv_sec, &timeout->tv_sec) ||
-            put_user(ktspec.tv_nsec, &timeout->tv_nsec)))
+       if (datagrams > 0 && put_compat_timespec(&ktspec, timeout))
                datagrams = -EFAULT;
 
        return datagrams;