Commit 87c319a2c3c2efd397281089b9cdce3050febeff

Authored by Chris Metcalf
1 parent 5a114b9866

tile: properly use COMPAT_SYSCALL_DEFINEx

This was pointed out by Al Viro.  Using the correct wrappers
properly does sign extension as necessary on syscall arguments.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

Showing 1 changed file with 19 additions and 16 deletions Side-by-side Diff

arch/tile/kernel/compat.c
... ... @@ -32,45 +32,48 @@
32 32 * adapt the usual convention.
33 33 */
34 34  
35   -long compat_sys_truncate64(char __user *filename, u32 dummy, u32 low, u32 high)
  35 +COMPAT_SYSCALL_DEFINE4(truncate64, char __user *, filename, u32, dummy,
  36 + u32, low, u32, high)
36 37 {
37 38 return sys_truncate(filename, ((loff_t)high << 32) | low);
38 39 }
39 40  
40   -long compat_sys_ftruncate64(unsigned int fd, u32 dummy, u32 low, u32 high)
  41 +COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy,
  42 + u32, low, u32, high)
41 43 {
42 44 return sys_ftruncate(fd, ((loff_t)high << 32) | low);
43 45 }
44 46  
45   -long compat_sys_pread64(unsigned int fd, char __user *ubuf, size_t count,
46   - u32 dummy, u32 low, u32 high)
  47 +COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf,
  48 + size_t, count, u32, dummy, u32, low, u32, high)
47 49 {
48 50 return sys_pread64(fd, ubuf, count, ((loff_t)high << 32) | low);
49 51 }
50 52  
51   -long compat_sys_pwrite64(unsigned int fd, char __user *ubuf, size_t count,
52   - u32 dummy, u32 low, u32 high)
  53 +COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf,
  54 + size_t, count, u32, dummy, u32, low, u32, high)
53 55 {
54 56 return sys_pwrite64(fd, ubuf, count, ((loff_t)high << 32) | low);
55 57 }
56 58  
57   -long compat_sys_lookup_dcookie(u32 low, u32 high, char __user *buf, size_t len)
  59 +COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, low, u32, high,
  60 + char __user *, buf, size_t, len)
58 61 {
59 62 return sys_lookup_dcookie(((loff_t)high << 32) | low, buf, len);
60 63 }
61 64  
62   -long compat_sys_sync_file_range2(int fd, unsigned int flags,
63   - u32 offset_lo, u32 offset_hi,
64   - u32 nbytes_lo, u32 nbytes_hi)
  65 +COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags,
  66 + u32, offset_lo, u32, offset_hi,
  67 + u32, nbytes_lo, u32, nbytes_hi)
65 68 {
66 69 return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo,
67 70 ((loff_t)nbytes_hi << 32) | nbytes_lo,
68 71 flags);
69 72 }
70 73  
71   -long compat_sys_fallocate(int fd, int mode,
72   - u32 offset_lo, u32 offset_hi,
73   - u32 len_lo, u32 len_hi)
  74 +COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode,
  75 + u32, offset_lo, u32, offset_hi,
  76 + u32, len_lo, u32, len_hi)
74 77 {
75 78 return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo,
76 79 ((loff_t)len_hi << 32) | len_lo);
... ... @@ -81,9 +84,9 @@
81 84 * offset_low as "unsigned long", thus making it possible to pass
82 85 * a sign-extended high 32 bits in offset_low.
83 86 */
84   -long compat_sys_llseek(unsigned int fd, unsigned int offset_high,
85   - unsigned int offset_low, loff_t __user * result,
86   - unsigned int origin)
  87 +COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high,
  88 + unsigned int, offset_low, loff_t __user *, result,
  89 + unsigned int, origin)
87 90 {
88 91 return sys_llseek(fd, offset_high, offset_low, result, origin);
89 92 }