usb: misc: remove unnecessary code
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Thu, 16 Feb 2017 21:25:44 +0000 (15:25 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Mar 2017 08:58:44 +0000 (17:58 +0900)
'val' is an unsigned variable, and less-than-zero comparison of an unsigned
variable is never true.

Addresses-Coverity-ID: 1230256
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/lvstest.c

index 77176511658f3328f830ecdbd056f072a6c84f8a..c7c210421217b228574e4565b7200600d2856814 100644 (file)
@@ -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),