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/dbefd3fd519c
branches:  trunk
changeset: 369234:dbefd3fd519c
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 8a6720652812 -r dbefd3fd519c 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
@@ -441,6 +441,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) {
@@ -3297,6 +3299,7 @@
                        }
                        IF_DEQUEUE(&ic->ic_mgtq, m);
                        ni = M_GETCTX(m, struct ieee80211_node *);
+                       KASSERT(ni != NULL);
                        M_CLEARCTX(m);
                        goto sendit;
                }
@@ -3307,6 +3310,7 @@
                        break;
 
                ni = M_GETCTX(m, struct ieee80211_node *);
+               KASSERT(ni != NULL);
                M_CLEARCTX(m);
                vap = ni->ni_vap;
 
@@ -3380,7 +3384,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