Patchwork spufs: remove redundant test on unsigned

login
register
mail settings
Submitter roel kluin
Date June 22, 2009, 10:20 p.m.
Message ID <4A4003AD.20408@gmail.com>
Download mbox | patch
Permalink /patch/29017/
State Not Applicable
Headers show

Comments

roel kluin - June 22, 2009, 10:20 p.m.
Unsigned `len' cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Or should it be `if (!buf || len > MAX)' and what should MAX be then?
Jeremy Kerr - June 23, 2009, 9:12 a.m.
Roel,

> Unsigned `len' cannot be less than 0.
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Thanks for the patch. However, we have a patch from Christoph Hellwig 
pending that will rework the sputrace code:

 http://patchwork.ozlabs.org/patch/28641/

It's currently queued in benh's tree, should be up soon.

Cheers,


Jeremy

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/sputrace.c b/arch/powerpc/platforms/cell/spufs/sputrace.c
index d0b1f3f..8f799ee 100644
--- a/arch/powerpc/platforms/cell/spufs/sputrace.c
+++ b/arch/powerpc/platforms/cell/spufs/sputrace.c
@@ -73,7 +73,7 @@  static ssize_t sputrace_read(struct file *file, char __user *buf,
 {
 	int error = 0, cnt = 0;
 
-	if (!buf || len < 0)
+	if (!buf)
 		return -EINVAL;
 
 	while (cnt < len) {