diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-10-06 17:02:23 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-10-06 17:02:23 +0000 |
commit | 6d045edac914cf1dce0b95f3dca7457446980468 (patch) | |
tree | f328056f48c0178a4acc57b716ca6a30ca16a2ef /sys | |
parent | 156eeb39197a70e7548075ea504fa5ee8984d659 (diff) |
Fold the bus_dmamap_destroy into the loop above
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pv/if_xnf.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c index 5e5dd4148a8..adec5ec6afa 100644 --- a/sys/dev/pv/if_xnf.c +++ b/sys/dev/pv/if_xnf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xnf.c,v 1.40 2016/10/06 17:00:25 mikeb Exp $ */ +/* $OpenBSD: if_xnf.c,v 1.41 2016/10/06 17:02:22 mikeb Exp $ */ /* * Copyright (c) 2015, 2016 Mike Belopuhov @@ -1015,17 +1015,13 @@ xnf_tx_ring_destroy(struct xnf_softc *sc) bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_dmap[i], 0, 0, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(sc->sc_dmat, sc->sc_tx_dmap[i]); + bus_dmamap_destroy(sc->sc_dmat, sc->sc_tx_dmap[i]); + sc->sc_tx_dmap[i] = NULL; if (sc->sc_tx_buf[i] == NULL) continue; m_free(sc->sc_tx_buf[i]); sc->sc_tx_buf[i] = NULL; } - for (i = 0; i < XNF_TX_DESC; i++) { - if (sc->sc_tx_dmap[i] == NULL) - continue; - bus_dmamap_destroy(sc->sc_dmat, sc->sc_tx_dmap[i]); - sc->sc_tx_dmap[i] = NULL; - } if (sc->sc_tx_rmap) { bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); |