sparc: switch compat pread64 and pwrite64 to COMPAT_SYSCALL_DEFINE
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 20 Mar 2018 03:48:30 +0000 (23:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 20 Mar 2018 16:05:16 +0000 (12:05 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/sparc/kernel/sys_sparc32.c
arch/sparc/kernel/systbls.h
arch/sparc/kernel/systbls_64.S

index b266797fee99f028f9ffe3eaed2b607158a6ead4..50e9e4fdd8c6f0305e2cccc5ace9144b2bafc333 100644 (file)
@@ -194,22 +194,16 @@ COMPAT_SYSCALL_DEFINE5(rt_sigaction, int, sig,
         return ret;
 }
 
-asmlinkage compat_ssize_t sys32_pread64(unsigned int fd,
-                                       char __user *ubuf,
-                                       compat_size_t count,
-                                       unsigned long poshi,
-                                       unsigned long poslo)
+COMPAT_SYSCALL_DEFINE5(pread64, unsigned int, fd, char __user *, ubuf,
+                       compat_size_t, count, u32, poshi, u32, poslo)
 {
-       return sys_pread64(fd, ubuf, count, (poshi << 32) | poslo);
+       return sys_pread64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
 }
 
-asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd,
-                                        char __user *ubuf,
-                                        compat_size_t count,
-                                        unsigned long poshi,
-                                        unsigned long poslo)
+COMPAT_SYSCALL_DEFINE5(pwrite64, unsigned int, fd, char __user *, ubuf,
+                       compat_size_t, count, u32, poshi, u32, poslo)
 {
-       return sys_pwrite64(fd, ubuf, count, (poshi << 32) | poslo);
+       return sys_pwrite64(fd, ubuf, count, ((u64)poshi << 32) | poslo);
 }
 
 COMPAT_SYSCALL_DEFINE4(readahead, int, fd, u32, offhi, u32, offlo,
index 0ff3da78e09b1efdbd2e81ce1dc324a8d8540bf6..922c253ee086a58e6624fa58e89993ee36951704 100644 (file)
@@ -65,16 +65,16 @@ asmlinkage long compat_sys_fstat64(unsigned int fd,
 asmlinkage long compat_sys_fstatat64(unsigned int dfd,
                                     const char __user *filename,
                                     struct compat_stat64 __user * statbuf, int flag);
-asmlinkage compat_ssize_t sys32_pread64(unsigned int fd,
+asmlinkage long compat_sys_pread64(unsigned int fd,
                                        char __user *ubuf,
                                        compat_size_t count,
-                                       unsigned long poshi,
-                                       unsigned long poslo);
-asmlinkage compat_ssize_t sys32_pwrite64(unsigned int fd,
+                                       u32 poshi,
+                                       u32 poslo);
+asmlinkage long compat_sys_pwrite64(unsigned int fd,
                                         char __user *ubuf,
                                         compat_size_t count,
-                                        unsigned long poshi,
-                                        unsigned long poslo);
+                                        u32 poshi,
+                                        u32 poslo);
 asmlinkage long compat_sys_readahead(int fd,
                                     unsigned offhi,
                                     unsigned offlo,
index 9d10daa5a121229a53ed0758b7d8ccd7d4129fdc..34dde99548b0fc828c0baeea34548ebb5f6dcbd3 100644 (file)
@@ -32,7 +32,7 @@ sys_call_table32:
 /*50*/ .word sys_getegid16, sys_acct, sys_nis_syscall, sys_getgid, compat_sys_ioctl
        .word sys_reboot, sys32_mmap2, sys_symlink, sys_readlink, sys32_execve
 /*60*/ .word sys_umask, sys_chroot, compat_sys_newfstat, compat_sys_fstat64, sys_getpagesize
-       .word sys_msync, sys_vfork, sys32_pread64, sys32_pwrite64, sys_geteuid
+       .word sys_msync, sys_vfork, compat_sys_pread64, compat_sys_pwrite64, sys_geteuid
 /*70*/ .word sys_getegid, sys_mmap, sys_setreuid, sys_munmap, sys_mprotect
        .word sys_madvise, sys_vhangup, sys32_truncate64, sys_mincore, sys_getgroups16
 /*80*/ .word sys_setgroups16, sys_getpgrp, sys_setgroups, compat_sys_setitimer, sys32_ftruncate64