]> git.karo-electronics.de Git - linux-beck.git/blobdiff - arch/powerpc/platforms/cell/spufs/file.c
powerpc/spufs: Don't spu_acquire_saved unnecessarily in regs read
[linux-beck.git] / arch / powerpc / platforms / cell / spufs / file.c
index f139cd8b594db6accac1757788feb5c9892d65d6..b6f7b917b56c6a4636517b8996120af7941597d1 100644 (file)
@@ -548,6 +548,11 @@ spufs_regs_read(struct file *file, char __user *buffer,
        int ret;
        struct spu_context *ctx = file->private_data;
 
+       /* pre-check for file position: if we'd return EOF, there's no point
+        * causing a deschedule */
+       if (*pos >= sizeof(ctx->csa.lscsa->gprs))
+               return 0;
+
        ret = spu_acquire_saved(ctx);
        if (ret)
                return ret;