Thread (2 messages) flat view 2 messages, 2 authors, 2009-03-04
STALE6397d

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

From: Roel Kluin <hidden>
Date: 2009-03-03 18:42:14
Subsystem: cell broadband engine architecture, linux for powerpc (32-bit and 64-bit), spu file system, the rest · Maintainers: Madhavan Srinivasan, Linus Torvalds

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

Signed-off-by: Roel Kluin <redacted>
---
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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help