[PATCH] powerpc/spufs: negative size in spufs_{regs/fpcr}_write

Roel Kluin roel.kluin at gmail.com
Wed Mar 4 05:42:14 EST 2009


When stored in size_t size, the test 'size <= 0' does no longer work.

Signed-off-by: Roel Kluin <roel.kluin at gmail.com>
---
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 0da7f2b..05dba47 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -569,7 +569,7 @@ spufs_regs_write(struct file *file, const char __user *buffer,
 	int ret;
 
 	size = min_t(ssize_t, sizeof lscsa->gprs - *pos, size);
-	if (size <= 0)
+	if ((ssize_t)size <= 0)
 		return -EFBIG;
 	*pos += size;
 
@@ -624,7 +624,7 @@ spufs_fpcr_write(struct file *file, const char __user * buffer,
 	int ret;
 
 	size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
-	if (size <= 0)
+	if ((ssize_t)size <= 0)
 		return -EFBIG;
 
 	ret = spu_acquire_saved(ctx);



More information about the Linuxppc-dev mailing list