[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>

authored by Matthew Wilcox and committed by Matthew Wilcox 17cca072 ee9f4b5d

+9 -6
+9 -6
arch/parisc/kernel/sys_parisc32.c
··· 111 111 112 112 asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) 113 113 { 114 + #ifndef CONFIG_SYSCTL_SYSCALL 115 + return -ENOSYS; 116 + #else 114 117 struct __sysctl_args32 tmp; 115 118 int error; 116 119 unsigned int oldlen32; 117 - size_t oldlen, *oldlenp = NULL; 120 + size_t oldlen, __user *oldlenp = NULL; 118 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 123 DBG(("sysctl32(%p)\n", args)); 123 124 ··· 145 144 } 146 145 147 146 lock_kernel(); 148 - error = do_sysctl((int *)(u64)tmp.name, tmp.nlen, (void *)(u64)tmp.oldval, 149 - oldlenp, (void *)(u64)tmp.newval, tmp.newlen); 147 + error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen, 148 + (void __user *)(u64)tmp.oldval, oldlenp, 149 + (void __user *)(u64)tmp.newval, tmp.newlen); 150 150 unlock_kernel(); 151 151 if (oldlenp) { 152 152 if (!error) { ··· 159 157 error = -EFAULT; 160 158 } 161 159 } 162 - if (copy_to_user(&args->__unused[0], tmp.__unused, sizeof(tmp.__unused))) 160 + if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused))) 163 161 error = -EFAULT; 164 162 } 165 163 return error; 164 + #endif 166 165 } 167 166 168 167 #endif /* CONFIG_SYSCTL */