Module Name: src
Committed By: skrll
Date: Sat Feb 15 09:26:07 UTC 2020
Modified Files:
src/sys/dev/usb: xhci.c
Log Message:
Change bNbrPorts for loop to start from 1 to match others. NFCI.
To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/usb/xhci.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.118 src/sys/dev/usb/xhci.c:1.119
--- src/sys/dev/usb/xhci.c:1.118 Sat Feb 15 01:21:56 2020
+++ src/sys/dev/usb/xhci.c Sat Feb 15 09:26:07 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: xhci.c,v 1.118 2020/02/15 01:21:56 riastradh Exp $ */
+/* $NetBSD: xhci.c,v 1.119 2020/02/15 09:26:07 skrll Exp $ */
/*
* Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.118 2020/02/15 01:21:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.119 2020/02/15 09:26:07 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -3175,9 +3175,9 @@ xhci_setup_route(struct usbd_pipe *pipe,
;
if (hub) {
int p;
- for (p = 0; p < hub->ud_hub->uh_hubdesc.bNbrPorts; p++) {
- if (hub->ud_hub->uh_ports[p].up_dev == adev) {
- dev->ud_myhsport = &hub->ud_hub->uh_ports[p];
+ for (p = 1; p <= hub->ud_hub->uh_hubdesc.bNbrPorts; p++) {
+ if (hub->ud_hub->uh_ports[p - 1].up_dev == adev) {
+ dev->ud_myhsport = &hub->ud_hub->uh_ports[p - 1];
goto found;
}
}