usb: misc: remove unnecessary code
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Mon, 20 Feb 2017 23:28:46 +0000 (17:28 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2017 04:24:49 +0000 (13:24 +0900)
'val' is an unsigned variable, and less-than-zero comparison of an unsigned
variable is never true.

Addresses-Coverity-ID: 1230257
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/lvstest.c

index b7fc978724de64998a8c322c54b7518df599a33f..c731a75f28ee6d60e39b534b92d49bdd34d885dd 100644 (file)
@@ -193,7 +193,7 @@ static ssize_t u2_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),