summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-03-18 15:50:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-19 15:10:55 +0100
commit22feda47b574c2854cc1a8447a2ae18598752375 (patch)
treee08b3911ff51463ca49a0b35bee8a06b4d53865a /drivers/usb
parentusb: common: Consider only available nodes for dr_mode (diff)
downloadlinux-22feda47b574c2854cc1a8447a2ae18598752375.tar.xz
linux-22feda47b574c2854cc1a8447a2ae18598752375.zip
usb: usb251xb: Remove unnecessary comparison of unsigned integer with >= 0
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/misc/usb251xb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
index 4d72b7d1d383..2c8e2cad7e10 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -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);
}