Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Change bNbrPorts for loop to start from 1 to mat...



details:   https://anonhg.NetBSD.org/src/rev/702c1c0a3860
branches:  trunk
changeset: 848949:702c1c0a3860
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Feb 15 09:26:07 2020 +0000

description:
Change bNbrPorts for loop to start from 1 to match others.  NFCI.

diffstat:

 sys/dev/usb/xhci.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 2f3d65a81631 -r 702c1c0a3860 sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Sat Feb 15 08:16:10 2020 +0000
+++ b/sys/dev/usb/xhci.c        Sat Feb 15 09:26:07 2020 +0000
@@ -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 @@
                ;
        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;
                        }
                }



Home | Main Index | Thread Index | Old Index