aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2011-03-17 15:39:49 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-04-13 19:19:47 -0400
commit22e0487047567252d5677ff35766cd884375efc2 (patch)
tree792d135afe30d6af87d38ff5a8eb010d39c86053 /drivers/usb/host/xhci-ring.c
parent5a6c2f3ff039154872ce597952f8b8900ea0d732 (diff)
USB: xhci: unsigned char never equals -1
There were some places that compared port_speed == -1 where port_speed is a u8. This doesn't work unless we cast the -1 to u8. Some places did it correctly. Instead of using -1 directly, I've created a DUPLICATE_ENTRY define which does the cast and is more descriptive as well. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index cfc1ad92473f..c6d1462aa1c3 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1209,7 +1209,7 @@ static unsigned int find_faked_portnum_from_hw_portnum(struct usb_hcd *hcd,
1209 * Skip ports that don't have known speeds, or have duplicate 1209 * Skip ports that don't have known speeds, or have duplicate
1210 * Extended Capabilities port speed entries. 1210 * Extended Capabilities port speed entries.
1211 */ 1211 */
1212 if (port_speed == 0 || port_speed == -1) 1212 if (port_speed == 0 || port_speed == DUPLICATE_ENTRY)
1213 continue; 1213 continue;
1214 1214
1215 /* 1215 /*
@@ -1260,7 +1260,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
1260 port_id); 1260 port_id);
1261 goto cleanup; 1261 goto cleanup;
1262 } 1262 }
1263 if (major_revision == (u8) -1) { 1263 if (major_revision == DUPLICATE_ENTRY) {
1264 xhci_warn(xhci, "Event for port %u duplicated in" 1264 xhci_warn(xhci, "Event for port %u duplicated in"
1265 "Extended Capabilities, ignoring.\n", 1265 "Extended Capabilities, ignoring.\n",
1266 port_id); 1266 port_id);