diff mbox

Sky CPU: redundant or incorrect tests on unsigned

Message ID 4A3FB3E2.7090309@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

roel kluin June 22, 2009, 4:40 p.m. UTC
count is unsigned and cannot be less than 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Can these be removed or do we need an `if (count > MAX)' test, and
what should MAX be then?
diff mbox

Patch

diff --git a/drivers/misc/hdpuftrs/hdpu_cpustate.c b/drivers/misc/hdpuftrs/hdpu_cpustate.c
index 176fe4e..35000cf 100644
--- a/drivers/misc/hdpuftrs/hdpu_cpustate.c
+++ b/drivers/misc/hdpuftrs/hdpu_cpustate.c
@@ -121,8 +121,6 @@  static ssize_t cpustate_read(struct file *file, char *buf,
 {
 	unsigned char data;
 
-	if (count < 0)
-		return -EFAULT;
 	if (count == 0)
 		return 0;
 
@@ -137,9 +135,6 @@  static ssize_t cpustate_write(struct file *file, const char *buf,
 {
 	unsigned char data;
 
-	if (count < 0)
-		return -EFAULT;
-
 	if (count == 0)
 		return 0;