aboutsummaryrefslogtreecommitdiff
path: root/arch/parisc/kernel
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2006-10-04 13:16:10 -0600
committerMatthew Wilcox <willy@hera.kernel.org>2006-10-05 01:48:17 +0000
commit17cca07237617a2d712eb44cffd8720055e61291 (patch)
treecd0b35fef694bab9c76b3f2336561adfadcddd35 /arch/parisc/kernel
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>
Diffstat (limited to 'arch/parisc/kernel')
-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 e3b30bc3645..e0e4e0bfcc6 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -111,13 +111,14 @@ struct __sysctl_args32 {
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
+#ifndef CONFIG_SYSCTL_SYSCALL
+ return -ENOSYS;
+#else
struct __sysctl_args32 tmp;
int error;
unsigned int oldlen32;
- size_t oldlen, *oldlenp = NULL;
+ size_t oldlen, __user *oldlenp = NULL;
unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
- extern int do_sysctl(int *name, int nlen, void *oldval, size_t *oldlenp,
- void *newval, size_t newlen);
DBG(("sysctl32(%p)\n", args));
@@ -144,8 +145,9 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
}
lock_kernel();
- error = do_sysctl((int *)(u64)tmp.name, tmp.nlen, (void *)(u64)tmp.oldval,
- oldlenp, (void *)(u64)tmp.newval, tmp.newlen);
+ error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
+ (void __user *)(u64)tmp.oldval, oldlenp,
+ (void __user *)(u64)tmp.newval, tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
@@ -157,10 +159,11 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
error = -EFAULT;
}
}
- if (copy_to_user(&args->__unused[0], tmp.__unused, sizeof(tmp.__unused)))
+ if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
+#endif
}
#endif /* CONFIG_SYSCTL */