diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-03 10:21:27 -0500 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-03-06 09:35:11 -0500 |
commit | 361d93c46f688d1a2209912bda377bdb48842cce (patch) | |
tree | ac83117eb7260d70969013892f725690ad7807dd /net/compat.c | |
parent | 62a6fa97684ed4c124564ea92500ecd513d60611 (diff) |
net/compat: convert to COMPAT_SYSCALL_DEFINE
Convert all compat system call functions where all parameter types
have a size of four or less than four bytes, or are pointer types
to COMPAT_SYSCALL_DEFINE.
The implicit casts within COMPAT_SYSCALL_DEFINE will perform proper
zero and sign extension to 64 bit of all parameters if needed.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/compat.c b/net/compat.c index f50161fb812e..706b78be9a23 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -384,8 +384,8 @@ static int compat_sock_setsockopt(struct socket *sock, int level, int optname, | |||
384 | return sock_setsockopt(sock, level, optname, optval, optlen); | 384 | return sock_setsockopt(sock, level, optname, optval, optlen); |
385 | } | 385 | } |
386 | 386 | ||
387 | asmlinkage long compat_sys_setsockopt(int fd, int level, int optname, | 387 | COMPAT_SYSCALL_DEFINE5(setsockopt, int, fd, int, level, int, optname, |
388 | char __user *optval, unsigned int optlen) | 388 | char __user *, optval, unsigned int, optlen) |
389 | { | 389 | { |
390 | int err; | 390 | int err; |
391 | struct socket *sock = sockfd_lookup(fd, &err); | 391 | struct socket *sock = sockfd_lookup(fd, &err); |
@@ -504,8 +504,8 @@ int compat_sock_get_timestampns(struct sock *sk, struct timespec __user *usersta | |||
504 | } | 504 | } |
505 | EXPORT_SYMBOL(compat_sock_get_timestampns); | 505 | EXPORT_SYMBOL(compat_sock_get_timestampns); |
506 | 506 | ||
507 | asmlinkage long compat_sys_getsockopt(int fd, int level, int optname, | 507 | COMPAT_SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname, |
508 | char __user *optval, int __user *optlen) | 508 | char __user *, optval, int __user *, optlen) |
509 | { | 509 | { |
510 | int err; | 510 | int err; |
511 | struct socket *sock = sockfd_lookup(fd, &err); | 511 | struct socket *sock = sockfd_lookup(fd, &err); |
@@ -735,15 +735,15 @@ static unsigned char nas[21] = { | |||
735 | }; | 735 | }; |
736 | #undef AL | 736 | #undef AL |
737 | 737 | ||
738 | asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) | 738 | COMPAT_SYSCALL_DEFINE3(sendmsg, int, fd, struct compat_msghdr __user *, msg, unsigned int, flags) |
739 | { | 739 | { |
740 | if (flags & MSG_CMSG_COMPAT) | 740 | if (flags & MSG_CMSG_COMPAT) |
741 | return -EINVAL; | 741 | return -EINVAL; |
742 | return __sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); | 742 | return __sys_sendmsg(fd, (struct msghdr __user *)msg, flags | MSG_CMSG_COMPAT); |
743 | } | 743 | } |
744 | 744 | ||
745 | asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 745 | COMPAT_SYSCALL_DEFINE4(sendmmsg, int, fd, struct compat_mmsghdr __user *, mmsg, |
746 | unsigned int vlen, unsigned int flags) | 746 | unsigned int, vlen, unsigned int, flags) |
747 | { | 747 | { |
748 | if (flags & MSG_CMSG_COMPAT) | 748 | if (flags & MSG_CMSG_COMPAT) |
749 | return -EINVAL; | 749 | return -EINVAL; |
@@ -751,7 +751,7 @@ asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg, | |||
751 | flags | MSG_CMSG_COMPAT); | 751 | flags | MSG_CMSG_COMPAT); |
752 | } | 752 | } |
753 | 753 | ||
754 | asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, unsigned int flags) | 754 | COMPAT_SYSCALL_DEFINE3(recvmsg, int, fd, struct compat_msghdr __user *, msg, unsigned int, flags) |
755 | { | 755 | { |
756 | if (flags & MSG_CMSG_COMPAT) | 756 | if (flags & MSG_CMSG_COMPAT) |
757 | return -EINVAL; | 757 | return -EINVAL; |
@@ -770,9 +770,9 @@ asmlinkage long compat_sys_recvfrom(int fd, void __user *buf, size_t len, | |||
770 | return sys_recvfrom(fd, buf, len, flags | MSG_CMSG_COMPAT, addr, addrlen); | 770 | return sys_recvfrom(fd, buf, len, flags | MSG_CMSG_COMPAT, addr, addrlen); |
771 | } | 771 | } |
772 | 772 | ||
773 | asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | 773 | COMPAT_SYSCALL_DEFINE5(recvmmsg, int, fd, struct compat_mmsghdr __user *, mmsg, |
774 | unsigned int vlen, unsigned int flags, | 774 | unsigned int, vlen, unsigned int, flags, |
775 | struct compat_timespec __user *timeout) | 775 | struct compat_timespec __user *, timeout) |
776 | { | 776 | { |
777 | int datagrams; | 777 | int datagrams; |
778 | struct timespec ktspec; | 778 | struct timespec ktspec; |
@@ -795,7 +795,7 @@ asmlinkage long compat_sys_recvmmsg(int fd, struct compat_mmsghdr __user *mmsg, | |||
795 | return datagrams; | 795 | return datagrams; |
796 | } | 796 | } |
797 | 797 | ||
798 | asmlinkage long compat_sys_socketcall(int call, u32 __user *args) | 798 | COMPAT_SYSCALL_DEFINE2(socketcall, int, call, u32 __user *, args) |
799 | { | 799 | { |
800 | int ret; | 800 | int ret; |
801 | u32 a[6]; | 801 | u32 a[6]; |