linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/spufs: negative size in spufs_{regs/fpcr}_write
@ 2009-03-03 18:42 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-03-03 18:42 UTC (permalink / raw)
  To: jk; +Cc: linuxppc-dev, Andrew Morton, cbe-oss-dev

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

Signed-off-by: Roel Kluin <roel.kluin@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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-03 18:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-03 18:42 [PATCH] powerpc/spufs: negative size in spufs_{regs/fpcr}_write Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).