Skip to contentSkip to conversation

usb: misc: remove unnecessary code

PATCH New Gustavo A. R. Silva 1 participant 1 message Feb 16, 2017 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: misc: remove unnecessary code

'val' is an unsigned variable, and less-than-zero comparison of an unsigned variable is never true.

Addresses-Coverity-ID: 1230256

---
 drivers/usb/misc/lvstest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/misc/lvstest.c +1 -1
index 7717651..c7c2104 100644
@@ -222,7 +222,7 @@ static ssize_t u1_timeout_store(struct device *dev,
 		return ret;
 	}
 
-	if (val < 0 || val > 127)
+	if (val > 127)
 		return -EINVAL;
 
 	ret = lvs_rh_set_port_feature(hdev, lvs->portnum | (val << 8),
Signature · 1 line
2.5.0