aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2006-10-04 15:16:10 -0400
committerMatthew Wilcox <willy@hera.kernel.org>2006-10-04 21:48:17 -0400
commit17cca07237617a2d712eb44cffd8720055e61291 (patch)
treecd0b35fef694bab9c76b3f2336561adfadcddd35
parentee9f4b5d95d03d1546f0d06cbe384bd4ab97bcba (diff)
[PA-RISC] Fix sys32_sysctl
When CONFIG_SYSCTL_SYSCALL isn't defined, do_sysctl doesn't exist and we fail to link. Fix with an ifdef, the same way sparc64 did. Also add some minor changes to be more like sparc64. Signed-off-by: Matthew Wilcox <matthew@wil.cx>
-rw-r--r--arch/parisc/kernel/sys_parisc32.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index e3b30bc36453..e0e4e0bfcc6b 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -111,13 +111,14 @@ struct __sysctl_args32 {
111 111
112asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) 112asmlinkage 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 */