diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 22:08:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 22:08:13 -0400 |
commit | 4b8447184ae85de4ce710e5f561fbaada21b8394 (patch) | |
tree | 71aed2c654a6d8d83beff480bc84d9e63b366858 /arch/parisc/kernel/sys_parisc32.c | |
parent | a43cdf08a1b1ab3c013059b5fa4c1b7561e53cb7 (diff) | |
parent | 1604f31895dcdb42edf6511ce7ef0546ff92c8e5 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/willy/parisc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/willy/parisc-2.6:
[PA-RISC] Fix time.c for new do_timer() calling convention
[PA-RISC] Fix must_check warnings in drivers.c
[PA-RISC] Fix parisc_newuname()
[PA-RISC] Remove warning from pci.c
[PA-RISC] Fix filldir warnings
[PA-RISC] Fix sys32_sysctl
[PA-RISC] Fix sba_iommu compilation
Diffstat (limited to 'arch/parisc/kernel/sys_parisc32.c')
-rw-r--r-- | arch/parisc/kernel/sys_parisc32.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index e3b30bc36453..29be4377aca6 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
@@ -111,13 +111,14 @@ struct __sysctl_args32 { | |||
111 | 111 | ||
112 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | 112 | asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) |
113 | { | 113 | { |
114 | #ifndef CONFIG_SYSCTL_SYSCALL | ||
115 | return -ENOSYS; | ||
116 | #else | ||
114 | struct __sysctl_args32 tmp; | 117 | struct __sysctl_args32 tmp; |
115 | int error; | 118 | int error; |
116 | unsigned int oldlen32; | 119 | unsigned int oldlen32; |
117 | size_t oldlen, *oldlenp = NULL; | 120 | size_t oldlen, __user *oldlenp = NULL; |
118 | unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7; | 121 | unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7; |
119 | extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp, | ||
120 | void *newval, size_t newlen); | ||
121 | 122 | ||
122 | DBG(("sysctl32(%p)\n", args)); | 123 | DBG(("sysctl32(%p)\n", args)); |
123 | 124 | ||
@@ -144,8 +145,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | |||
144 | } | 145 | } |
145 | 146 | ||
146 | lock_kernel(); | 147 | lock_kernel(); |
147 | error = do_sysctl((int *)(u64)tmp.name, tmp.nlen, (void *)(u64)tmp.oldval, | 148 | error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen, |
148 | oldlenp, (void *)(u64)tmp.newval, tmp.newlen); | 149 | (void __user *)(u64)tmp.oldval, oldlenp, |
150 | (void __user *)(u64)tmp.newval, tmp.newlen); | ||
149 | unlock_kernel(); | 151 | unlock_kernel(); |
150 | if (oldlenp) { | 152 | if (oldlenp) { |
151 | if (!error) { | 153 | if (!error) { |
@@ -157,10 +159,11 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) | |||
157 | error = -EFAULT; | 159 | error = -EFAULT; |
158 | } | 160 | } |
159 | } | 161 | } |
160 | if (copy_to_user(&args->__unused[0], tmp.__unused, sizeof(tmp.__unused))) | 162 | if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) |
161 | error = -EFAULT; | 163 | error = -EFAULT; |
162 | } | 164 | } |
163 | return error; | 165 | return error; |
166 | #endif | ||
164 | } | 167 | } |
165 | 168 | ||
166 | #endif /* CONFIG_SYSCTL */ | 169 | #endif /* CONFIG_SYSCTL */ |
@@ -310,9 +313,8 @@ struct readdir32_callback { | |||
310 | 313 | ||
311 | #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) | 314 | #define ROUND_UP(x,a) ((__typeof__(x))(((unsigned long)(x) + ((a) - 1)) & ~((a) - 1))) |
312 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) | 315 | #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) |
313 | static int | 316 | static int filldir32 (void *__buf, const char *name, int namlen, |
314 | filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino, | 317 | loff_t offset, u64 ino, unsigned int d_type) |
315 | unsigned int d_type) | ||
316 | { | 318 | { |
317 | struct linux32_dirent __user * dirent; | 319 | struct linux32_dirent __user * dirent; |
318 | struct getdents32_callback * buf = (struct getdents32_callback *) __buf; | 320 | struct getdents32_callback * buf = (struct getdents32_callback *) __buf; |
@@ -374,9 +376,8 @@ out: | |||
374 | return error; | 376 | return error; |
375 | } | 377 | } |
376 | 378 | ||
377 | static int | 379 | static int fillonedir32(void * __buf, const char * name, int namlen, |
378 | fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, | 380 | loff_t offset, u64 ino, unsigned int d_type) |
379 | unsigned int d_type) | ||
380 | { | 381 | { |
381 | struct readdir32_callback * buf = (struct readdir32_callback *) __buf; | 382 | struct readdir32_callback * buf = (struct readdir32_callback *) __buf; |
382 | struct old_linux32_dirent __user * dirent; | 383 | struct old_linux32_dirent __user * dirent; |