Merge ../linux-2.6-watchdog-mm
[linux-drm-fsl-dcu.git] / arch / powerpc / platforms / cell / spufs / syscalls.c
index d549aa7ebea6175eefc3c38eefadd189e949211c..a6d1ae4dc2a330797f7952008aef3495fd1cc67b 100644 (file)
  * value of the spu_status register after the SPU has stopped.
  *
  */
-long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus)
+static long do_spu_run(struct file *filp,
+                       __u32 __user *unpc,
+                       __u32 __user *ustatus)
 {
        long ret;
        struct spufs_inode_info *i;
        u32 npc, status;
 
        ret = -EFAULT;
-       if (get_user(npc, unpc) || get_user(status, ustatus))
+       if (get_user(npc, unpc))
                goto out;
 
        /* check if this file was created by spu_create */
@@ -47,7 +49,10 @@ long do_spu_run(struct file *filp, __u32 __user *unpc, __u32 __user *ustatus)
        i = SPUFS_I(filp->f_dentry->d_inode);
        ret = spufs_run_spu(filp, i->i_ctx, &npc, &status);
 
-       if (put_user(npc, unpc) || put_user(status, ustatus))
+       if (put_user(npc, unpc))
+               ret = -EFAULT;
+
+       if (ustatus && put_user(status, ustatus))
                ret = -EFAULT;
 out:
        return ret;
@@ -85,7 +90,7 @@ asmlinkage long sys_spu_create(const char __user *pathname,
                ret = path_lookup(tmp, LOOKUP_PARENT|
                                LOOKUP_OPEN|LOOKUP_CREATE, &nd);
                if (!ret) {
-                       ret = spufs_create_thread(&nd, flags, mode);
+                       ret = spufs_create(&nd, flags, mode);
                        path_release(&nd);
                }
                putname(tmp);