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 Remove unused/superflous mutices.



details:   https://anonhg.NetBSD.org/src-all/rev/6644c64cfa4c
branches:  trunk
changeset: 364991:6644c64cfa4c
user:      Martin Husemann <martin%NetBSD.org@localhost>
date:      Sat Dec 19 16:17:29 2020 +0100

description:
Remove unused/superflous mutices.

diffstat:

 sys/dev/usb/if_urtwn.c    |   8 +-------
 sys/dev/usb/if_urtwnvar.h |  10 ++++------
 2 files changed, 5 insertions(+), 13 deletions(-)

diffs (70 lines):

diff -r f21a0e0028bc -r 6644c64cfa4c sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Tue Dec 15 21:27:32 2020 +0100
+++ b/sys/dev/usb/if_urtwn.c    Sat Dec 19 16:17:29 2020 +0100
@@ -429,10 +429,8 @@
        mutex_init(&sc->sc_task_mtx, MUTEX_DEFAULT, IPL_NET);
        mutex_init(&sc->sc_tx_mtx, MUTEX_DEFAULT, IPL_SOFTNET);
        mutex_init(&sc->sc_rx_mtx, MUTEX_DEFAULT, IPL_SOFTNET);
-       mutex_init(&sc->sc_media_mtx, MUTEX_DEFAULT, IPL_SOFTNET);
        mutex_init(&sc->sc_fwcmd_mtx, MUTEX_DEFAULT, IPL_NONE);
        mutex_init(&sc->sc_write_mtx, MUTEX_DEFAULT, IPL_NONE);
-       mutex_init(&sc->sc_state_mtx, MUTEX_DEFAULT, IPL_NONE);
 
        mutex_enter(&sc->sc_write_mtx);
        usb_init_task(&sc->sc_task, urtwn_task, sc, 0);
@@ -651,10 +649,8 @@
 
        callout_destroy(&sc->sc_calib_to);
 
-       mutex_destroy(&sc->sc_state_mtx);
        mutex_destroy(&sc->sc_write_mtx);
        mutex_destroy(&sc->sc_fwcmd_mtx);
-       mutex_destroy(&sc->sc_media_mtx);
        mutex_destroy(&sc->sc_tx_mtx);
        mutex_destroy(&sc->sc_rx_mtx);
        mutex_destroy(&sc->sc_task_mtx);
@@ -2270,7 +2266,6 @@
            ieee80211_state_name[nstate], nstate));
 
        s = splnet();
-       mutex_enter(&sc->sc_state_mtx);
        mutex_enter(&sc->sc_write_mtx);
 
        callout_stop(&sc->sc_calib_to);
@@ -2569,7 +2564,6 @@
                break;
        }
        mutex_exit(&sc->sc_write_mtx);
-       mutex_exit(&sc->sc_state_mtx);
        splx(s);
 
        return (*uvap->newstate)(vap, nstate, arg);
@@ -3448,7 +3442,7 @@
                return;
 
        s = splnet();
-       mutex_enter(&sc->sc_tx_mtx);
+       mutex_enter(&sc->sc_tx_mtx); // XXX wrong mutex?
 
        if (ic->ic_nrunning > 0) {
                if (ISSET(URTWN_FLAG_FWREADY, sc->sc_flags)) {
diff -r f21a0e0028bc -r 6644c64cfa4c sys/dev/usb/if_urtwnvar.h
--- a/sys/dev/usb/if_urtwnvar.h Tue Dec 15 21:27:32 2020 +0100
+++ b/sys/dev/usb/if_urtwnvar.h Sat Dec 19 16:17:29 2020 +0100
@@ -129,12 +129,10 @@
 
        kcondvar_t                      sc_task_cv;
        kmutex_t                        sc_task_mtx;
-       kmutex_t                        sc_fwcmd_mtx;
-       kmutex_t                        sc_tx_mtx;
-       kmutex_t                        sc_rx_mtx;
-       kmutex_t                        sc_write_mtx;
-       kmutex_t                        sc_state_mtx;
-       kmutex_t                        sc_media_mtx;   /* XXX */
+       kmutex_t                        sc_fwcmd_mtx;   /* firmware commands */
+       kmutex_t                        sc_tx_mtx;      /* tx ring */
+       kmutex_t                        sc_rx_mtx;      /* rx ring */
+       kmutex_t                        sc_write_mtx;   /* softc */
 
        struct usbd_pipe *              rx_pipe[R92C_MAX_EPIN];
        int                             rx_npipe;



Home | Main Index | Thread Index | Old Index