Skip to contentSkip to conversation

Sky CPU: redundant or incorrect tests on unsigned

PATCH New Roel Kluin 1 participant 1 message Jun 22, 2009 Char and misc drivers

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 Sky CPU: redundant or incorrect tests on unsigned

count is unsigned and cannot be less than 0.

---
Can these be removed or do we need an `if (count > MAX)' test, and what should MAX be then?

drivers/misc/hdpuftrs/hdpu_cpustate.c +0 -5
index 176fe4e..35000cf 100644
@@ -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;