Source-Changes-HG archive

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

[src/nick-nhusb]: src/sys/dev/usb #ifdef DIAGNOSTIC -> KASSERT and add anothe...



details:   https://anonhg.NetBSD.org/src/rev/146c20cfad1d
branches:  nick-nhusb
changeset: 804795:146c20cfad1d
user:      skrll <skrll%NetBSD.org@localhost>
date:      Tue Sep 05 07:01:12 2017 +0000

description:
#ifdef DIAGNOSTIC -> KASSERT and add another KASSERT

diffstat:

 sys/dev/usb/ehci.c |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (51 lines):

diff -r e3b706ae5a3d -r 146c20cfad1d sys/dev/usb/ehci.c
--- a/sys/dev/usb/ehci.c        Tue Sep 05 06:58:51 2017 +0000
+++ b/sys/dev/usb/ehci.c        Tue Sep 05 07:01:12 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ehci.c,v 1.234.2.109 2017/08/28 17:52:27 skrll Exp $ */
+/*     $NetBSD: ehci.c,v 1.234.2.110 2017/09/05 07:01:12 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.109 2017/08/28 17:52:27 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.110 2017/09/05 07:01:12 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3154,10 +3154,8 @@
         */
        if (xfer->ux_hcflags & UXFER_ABORTING) {
                DPRINTF("already aborting", 0, 0, 0, 0);
-#ifdef DIAGNOSTIC
-               if (status == USBD_TIMEOUT)
-                       printf("ehci_abort_xfer: TIMEOUT while aborting\n");
-#endif
+               KASSERT(status != USBD_TIMEOUT);
+
                /* Override the status which might be USBD_TIMEOUT. */
                xfer->ux_status = status;
                DPRINTF("waiting for abort to finish", 0, 0, 0, 0);
@@ -3313,10 +3311,7 @@
        if (xfer->ux_hcflags & UXFER_ABORTING) {
                DPRINTF("already aborting", 0, 0, 0, 0);
 
-#ifdef DIAGNOSTIC
-               if (status == USBD_TIMEOUT)
-                       printf("ehci_abort_isoc_xfer: TIMEOUT while aborting\n");
-#endif
+               KASSERT(status != USBD_TIMEOUT);
 
                xfer->ux_status = status;
                DPRINTF("waiting for abort to finish", 0, 0, 0, 0);
@@ -3445,6 +3440,7 @@
        DPRINTF("xfer=%p", xfer, 0, 0, 0);
 
        mutex_enter(&sc->sc_lock);
+       KASSERT(xfer->ux_status == USBD_TIMEOUT);
        ehci_abort_xfer(xfer, USBD_TIMEOUT);
        mutex_exit(&sc->sc_lock);
 }



Home | Main Index | Thread Index | Old Index