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/e1faf552d53a
branches:  trunk
changeset: 365543:e1faf552d53a
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 2d6967fc9197 -r e1faf552d53a 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
@@ -440,6 +440,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) {
@@ -3295,6 +3297,7 @@
                        }
                        IF_DEQUEUE(&ic->ic_mgtq, m);
                        ni = M_GETCTX(m, struct ieee80211_node *);
+                       KASSERT(ni != NULL);
                        M_CLEARCTX(m);
                        goto sendit;
                }
@@ -3305,6 +3308,7 @@
                        break;
 
                ni = M_GETCTX(m, struct ieee80211_node *);
+               KASSERT(ni != NULL);
                M_CLEARCTX(m);
                vap = ni->ni_vap;
 
@@ -3378,7 +3382,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