[PATCH] usb: usb251xb: remove >=0 check for u32 port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The compiler rightfully complains:

  drivers/usb/misc/usb251xb.c: In function ‘usb251xb_get_ofdata’:
  drivers/usb/misc/usb251xb.c:563:13: warning: comparison of unsigned expression in ‘>= 0’ is always true [-Wtype-limits]
    563 |   if ((port >= 0) && (port <= data->port_cnt))

so drop the check.

Signed-off-by: Rouven Czerwinski <r.czerwinski@xxxxxxxxxxxxxx>
---
 drivers/usb/misc/usb251xb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c
index 10d5aa310b..e282988fb4 100644
--- a/drivers/usb/misc/usb251xb.c
+++ b/drivers/usb/misc/usb251xb.c
@@ -560,7 +560,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);
 	}
 
-- 
2.31.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux