]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PA-RISC] Fix parisc_newuname()
authorMatthew Wilcox <matthew@wil.cx>
Wed, 4 Oct 2006 19:33:53 +0000 (13:33 -0600)
committerMatthew Wilcox <willy@hera.kernel.org>
Thu, 5 Oct 2006 01:48:18 +0000 (01:48 +0000)
The utsname virtualisation broke parisc_newuname compilation.
Rewrite the implementation to call sys_newuname() like sparc64 does.

Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
arch/parisc/kernel/sys_parisc.c

index 1db5588ceacf7474ebba8d947b6b7c31da09a906..512642d8f707ce7208a99b5c0e2136c02c065c5e 100644 (file)
@@ -266,30 +266,17 @@ long parisc_personality(unsigned long personality)
        return err;
 }
 
-static inline int override_machine(char __user *mach) {
-#ifdef CONFIG_COMPAT
-       if (personality(current->personality) == PER_LINUX32) {
-               if (__put_user(0, mach + 6) ||
-                   __put_user(0, mach + 7))
-                       return -EFAULT;
-       }
-
-       return 0;
-#else /*!CONFIG_COMPAT*/
-       return 0;
-#endif /*CONFIG_COMPAT*/
-}
-
-long parisc_newuname(struct new_utsname __user *utsname)
+long parisc_newuname(struct new_utsname __user *name)
 {
-       int err = 0;
+       int err = sys_newuname(name);
 
-       down_read(&uts_sem);
-       if (copy_to_user(utsname, &system_utsname, sizeof(*utsname)))
-               err = -EFAULT;
-       up_read(&uts_sem);
-
-       err = override_machine(utsname->machine);
+#ifdef CONFIG_COMPAT
+       if (!err && personality(current->personality) == PER_LINUX32) {
+               if (__put_user(0, name->machine + 6) ||
+                   __put_user(0, name->machine + 7))
+                       err = -EFAULT;
+       }
+#endif
 
-       return (long)err;
+       return err;
 }