]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
usb: usb251xb: Remove unnecessary comparison of unsigned integer with >= 0
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 18 Mar 2019 14:50:24 +0000 (09:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Mar 2019 14:10:55 +0000 (15:10 +0100)
There is no need to compare *port* with >= 0 because such comparison
of an unsigned value is always true.

Fix this by removing such comparison.

Addresses-Coverity-ID: 1443949 ("Unsigned compared against 0")
Fixes: 02a50b875046 ("usb: usb251xb: add usb data lane port swap feature")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usb251xb.c

index 4d72b7d1d383be2643d09756f11f709a8b1906a5..2c8e2cad7e100b592e7b171bca89c24afede095c 100644 (file)
@@ -547,7 +547,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub,
         */
        hub->port_swap = USB251XB_DEF_PORT_SWAP;
        of_property_for_each_u32(np, "swap-dx-lanes", prop, p, port) {
-               if ((port >= 0) && (port <= data->port_cnt))
+               if (port <= data->port_cnt)
                        hub->port_swap |= BIT(port);
        }