Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Minor callout optimization, sprinkle a few...



details:   https://anonhg.NetBSD.org/src-all/rev/98279ff057d2
branches:  trunk
changeset: 989787:98279ff057d2
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Thu Dec 10 15:49:43 2020 +0100

description:
Minor callout optimization, sprinkle a few KASSERT.

diffstat:

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

diffs (37 lines):

diff -r 6d6a8a1ed9bf -r 98279ff057d2 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Thu Dec 10 15:44:21 2020 +0100
+++ b/sys/dev/usb/if_urtwn.c    Thu Dec 10 15:49:43 2020 +0100
@@ -439,6 +439,8 @@
        /* NNN make these callouts use a vap ... in vap create??? */
        callout_init(&sc->sc_calib_to, 0);
        callout_setfunc(&sc->sc_calib_to, urtwn_calib_to, sc);
+       callout_init(&sc->sc_watchdog_to, 0);
+       callout_setfunc(&sc->sc_watchdog_to, urtwn_watchdog, sc);
 
        error = usbd_set_config_no(sc->sc_udev, 1, 0);
        if (error != 0) {
@@ -3294,6 +3296,7 @@
                        }
                        IF_DEQUEUE(&ic->ic_mgtq, m);
                        ni = M_GETCTX(m, struct ieee80211_node *);
+                       KASSERT(ni != NULL);
                        M_CLEARCTX(m);
                        goto sendit;
                }
@@ -3304,6 +3307,7 @@
                        break;
 
                ni = M_GETCTX(m, struct ieee80211_node *);
+               KASSERT(ni != NULL);
                M_CLEARCTX(m);
                vap = ni->ni_vap;
 
@@ -3377,7 +3381,7 @@
                m_freem(m);
                ieee80211_free_node(ni);
                sc->tx_timer = 5;
-               callout_reset(&sc->sc_watchdog_to, hz, urtwn_watchdog, sc);
+               callout_schedule(&sc->sc_watchdog_to, hz);
        }
 }
 



Home | Main Index | Thread Index | Old Index