Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb add KASSERT() that sc_child* is set...



details:   https://anonhg.NetBSD.org/src/rev/ebfd142516d2
branches:  trunk
changeset: 318407:ebfd142516d2
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Apr 21 15:53:24 2018 +0000
description:
add KASSERT() that sc_child* is set to NULL after child detach; just for
readability, it's not immediatelly obvious this is done in xhci_childdet()

no functional changes

diffstat:

 sys/dev/usb/xhci.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 70c90f0cab42 -r ebfd142516d2 sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Sat Apr 21 15:10:28 2018 +0000
+++ b/sys/dev/usb/xhci.c        Sat Apr 21 15:53:24 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.87 2018/04/09 16:21:11 jakllsch Exp $       */
+/*     $NetBSD: xhci.c,v 1.88 2018/04/21 15:53:24 jdolecek Exp $       */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.87 2018/04/09 16:21:11 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.88 2018/04/21 15:53:24 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -593,12 +593,14 @@
                rv = config_detach(sc->sc_child2, flags);
                if (rv != 0)
                        return rv;
+               KASSERT(sc->sc_child2 == NULL);
        }
 
        if (sc->sc_child != NULL) {
                rv = config_detach(sc->sc_child, flags);
                if (rv != 0)
                        return rv;
+               KASSERT(sc->sc_child == NULL);
        }
 
        /* XXX unconfigure/free slots */



Home | Main Index | Thread Index | Old Index