diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-06-04 16:56:21 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2009-06-04 16:56:21 +0000 |
commit | c154d037c3a3075ffc0e8b1b25ecfc8a03a77c19 (patch) | |
tree | c63546cf7c24c85bfc878306fd68e4ce18e1a639 /sys/dev | |
parent | 918ea9fdd06d5989d37488280e79afd8b0aa95d8 (diff) |
move redundant bus_dmamap_sync calls outside an if/else block.
from Brad; ok chris@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/if_vr.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 9aa602e23e2..c27788742d9 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.94 2009/05/29 06:57:21 mpf Exp $ */ +/* $OpenBSD: if_vr.c,v 1.95 2009/06/04 16:56:20 sthen Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1182,18 +1182,17 @@ vr_encap(struct vr_softc *sc, struct vr_chain *c, struct mbuf *m_head) m_freem(m_new); return (1); } - bus_dmamap_sync(sc->sc_dmat, c->vr_map, 0, c->vr_map->dm_mapsize, - BUS_DMASYNC_PREWRITE); + } + + bus_dmamap_sync(sc->sc_dmat, c->vr_map, 0, c->vr_map->dm_mapsize, + BUS_DMASYNC_PREWRITE); + if (m_new != NULL) { m_freem(m_head); c->vr_mbuf = m_new; - } else { - bus_dmamap_sync(sc->sc_dmat, c->vr_map, 0, c->vr_map->dm_mapsize, - BUS_DMASYNC_PREWRITE); - - c->vr_mbuf = m_head; - } + } else + c->vr_mbuf = m_head; f = c->vr_ptr; f->vr_data = htole32(c->vr_map->dm_segs[0].ds_addr); |