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/f03d1389699c
branches:  trunk
changeset: 947483:f03d1389699c
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 38fde17dfb2c -r f03d1389699c 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
@@ -437,6 +437,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) {
@@ -3279,6 +3281,7 @@
                        }
                        IF_DEQUEUE(&ic->ic_mgtq, m);
                        ni = M_GETCTX(m, struct ieee80211_node *);
+                       KASSERT(ni != NULL);
                        M_CLEARCTX(m);
                        goto sendit;
                }
@@ -3289,6 +3292,7 @@
                        break;
 
                ni = M_GETCTX(m, struct ieee80211_node *);
+               KASSERT(ni != NULL);
                M_CLEARCTX(m);
                vap = ni->ni_vap;
 
@@ -3338,7 +3342,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