diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2013-08-21 05:21:47 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2013-08-21 05:21:47 +0000 |
commit | 6c6287fe271247607d595cdf2777af3e65547680 (patch) | |
tree | a8c0feda16a4dbe1b9ec8258e9a50ceaccf30e16 /sys/dev | |
parent | a83165bd346e9097817cfc2dbbdf05990cc2fa80 (diff) |
get rid of the copy argument in m_devget that let you provide an
alternative to bcopy since noone uses it.
while there use memcpy instead of bcopy because we know the memory cannot
overlap.
ok henning@ matthew@ mikeb@ deraadt@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/dc.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/mtd8xx.c | 5 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/ti.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ale.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_bce.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_cas.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/if_lge.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_nge.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_sis.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_sk.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_vge.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_vr.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_wb.c | 4 | ||||
-rw-r--r-- | sys/dev/pcmcia/if_malo.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_upgt.c | 4 |
16 files changed, 34 insertions, 37 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index ea1f251b3cc..4bf3b26a21e 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.126 2013/08/07 01:06:29 bluhm Exp $ */ +/* $OpenBSD: dc.c,v 1.127 2013/08/21 05:21:43 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -2185,8 +2185,7 @@ dc_rxeof(struct dc_softc *sc) total_len -= ETHER_CRC_LEN; m->m_pkthdr.rcvif = ifp; - m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, - ifp, NULL); + m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp); dc_newbuf(sc, i, m); DC_INC(i, DC_RX_LIST_CNT); if (m0 == NULL) { diff --git a/sys/dev/ic/mtd8xx.c b/sys/dev/ic/mtd8xx.c index 5e416f2fc8c..add477fefc5 100644 --- a/sys/dev/ic/mtd8xx.c +++ b/sys/dev/ic/mtd8xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtd8xx.c,v 1.19 2012/11/29 21:10:32 brad Exp $ */ +/* $OpenBSD: mtd8xx.c,v 1.20 2013/08/21 05:21:43 dlg Exp $ */ /* * Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru> @@ -926,8 +926,7 @@ mtd_rxeof(struct mtd_softc *sc) 0, sc->mtd_cdata.mtd_rx_chain[i].sd_map->dm_mapsize, BUS_DMASYNC_POSTREAD); - m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, - ifp, NULL); + m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, ifp); mtd_newbuf(sc, i, m); i = (i + 1) % MTD_RX_LIST_CNT; if (m0 == NULL) { diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index 6beb7559ad1..ea3430b3d65 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.78 2013/08/07 01:06:31 bluhm Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.79 2013/08/21 05:21:43 dlg Exp $ */ /* * Copyright (c) 1997, 1998 @@ -650,7 +650,7 @@ rl_rxeof(struct rl_softc *sc) wrap = (sc->rl_cdata.rl_rx_buf + RL_RXBUFLEN) - rxbufpos; if (total_len > wrap) { - m = m_devget(rxbufpos, wrap, ETHER_ALIGN, ifp, NULL); + m = m_devget(rxbufpos, wrap, ETHER_ALIGN, ifp); if (m != NULL) { m_copyback(m, wrap, total_len - wrap, sc->rl_cdata.rl_rx_buf, M_NOWAIT); @@ -661,8 +661,7 @@ rl_rxeof(struct rl_softc *sc) } cur_rx = (total_len - wrap + ETHER_CRC_LEN); } else { - m = m_devget(rxbufpos, total_len, ETHER_ALIGN, ifp, - NULL); + m = m_devget(rxbufpos, total_len, ETHER_ALIGN, ifp); cur_rx += total_len + 4 + ETHER_CRC_LEN; } diff --git a/sys/dev/ic/ti.c b/sys/dev/ic/ti.c index 078b078bdb5..0adef4bf466 100644 --- a/sys/dev/ic/ti.c +++ b/sys/dev/ic/ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ti.c,v 1.5 2013/08/07 01:06:31 bluhm Exp $ */ +/* $OpenBSD: ti.c,v 1.6 2013/08/21 05:21:43 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1742,7 +1742,7 @@ ti_rxeof(struct ti_softc *sc) == ENOBUFS) { struct mbuf *m0; m0 = m_devget(mtod(m, char *), cur_rx->ti_len, - ETHER_ALIGN, ifp, NULL); + ETHER_ALIGN, ifp); ti_newbuf_jumbo(sc, sc->ti_jumbo, m); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_ale.c b/sys/dev/pci/if_ale.c index 3794f9b0530..aadeb1c96b5 100644 --- a/sys/dev/pci/if_ale.c +++ b/sys/dev/pci/if_ale.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ale.c,v 1.27 2013/08/07 01:06:33 bluhm Exp $ */ +/* $OpenBSD: if_ale.c,v 1.28 2013/08/21 05:21:43 dlg Exp $ */ /*- * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> * All rights reserved. @@ -1548,7 +1548,7 @@ ale_rxeof(struct ale_softc *sc) * on these low-end consumer ethernet controller. */ m = m_devget((char *)(rs + 1), length - ETHER_CRC_LEN, - ETHER_ALIGN, ifp, NULL); + ETHER_ALIGN, ifp); if (m == NULL) { ifp->if_iqdrops++; ale_rx_update_page(sc, &rx_page, length, &prod); diff --git a/sys/dev/pci/if_bce.c b/sys/dev/pci/if_bce.c index 5ef750d3464..5b745973e6e 100644 --- a/sys/dev/pci/if_bce.c +++ b/sys/dev/pci/if_bce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bce.c,v 1.36 2013/08/07 01:06:33 bluhm Exp $ */ +/* $OpenBSD: if_bce.c,v 1.37 2013/08/21 05:21:43 dlg Exp $ */ /* $NetBSD: if_bce.c,v 1.3 2003/09/29 01:53:02 mrg Exp $ */ /* @@ -753,7 +753,7 @@ bce_rxintr(struct bce_softc *sc) len -= ETHER_CRC_LEN; m = m_devget(sc->bce_data + i * MCLBYTES + - BCE_PREPKT_HEADER_SIZE, len, ETHER_ALIGN, ifp, NULL); + BCE_PREPKT_HEADER_SIZE, len, ETHER_ALIGN, ifp); ifp->if_ipackets++; #if NBPFILTER > 0 diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index cd62796915d..37d6985418a 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cas.c,v 1.32 2011/04/03 15:36:02 jasper Exp $ */ +/* $OpenBSD: if_cas.c,v 1.33 2013/08/21 05:21:44 dlg Exp $ */ /* * @@ -1192,7 +1192,7 @@ cas_rint(struct cas_softc *sc) rxs->rxs_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD); cp = rxs->rxs_kva + off * 256 + ETHER_ALIGN; - m = m_devget(cp, len, ETHER_ALIGN, ifp, NULL); + m = m_devget(cp, len, ETHER_ALIGN, ifp); if (word[0] & CAS_RC0_RELEASE_HDR) cas_add_rxbuf(sc, idx); @@ -1228,7 +1228,7 @@ cas_rint(struct cas_softc *sc) /* XXX We should not be copying the packet here. */ cp = rxs->rxs_kva + off + ETHER_ALIGN; - m = m_devget(cp, len, ETHER_ALIGN, ifp, NULL); + m = m_devget(cp, len, ETHER_ALIGN, ifp); if (word[0] & CAS_RC0_RELEASE_DATA) cas_add_rxbuf(sc, idx); diff --git a/sys/dev/pci/if_lge.c b/sys/dev/pci/if_lge.c index fa97c0854a7..7c4977aaac6 100644 --- a/sys/dev/pci/if_lge.c +++ b/sys/dev/pci/if_lge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lge.c,v 1.58 2013/08/07 01:06:36 bluhm Exp $ */ +/* $OpenBSD: if_lge.c,v 1.59 2013/08/21 05:21:44 dlg Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -890,7 +890,7 @@ lge_rxeof(struct lge_softc *sc, int cnt) if (lge_newbuf(sc, &LGE_RXTAIL(sc), NULL) == ENOBUFS) { m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, - ifp, NULL); + ifp); lge_newbuf(sc, &LGE_RXTAIL(sc), m); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index 5c47a37cae7..bfc983d2f75 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.74 2013/08/07 01:06:36 bluhm Exp $ */ +/* $OpenBSD: if_nge.c,v 1.75 2013/08/21 05:21:44 dlg Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -1295,7 +1295,7 @@ nge_rxeof(sc) if (nge_newbuf(sc, cur_rx, NULL) == ENOBUFS) { #endif m0 = m_devget(mtod(m, char *), total_len, - ETHER_ALIGN, ifp, NULL); + ETHER_ALIGN, ifp); nge_newbuf(sc, cur_rx, m); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 10c13e8b73f..b33fe005453 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.112 2013/08/07 01:06:37 bluhm Exp $ */ +/* $OpenBSD: if_sis.c,v 1.113 2013/08/21 05:21:44 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -1402,7 +1402,7 @@ sis_rxeof(struct sis_softc *sc) { struct mbuf *m0; m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, - ifp, NULL); + ifp); m_freem(m); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_sk.c b/sys/dev/pci/if_sk.c index 2cbb83fdbac..85269227228 100644 --- a/sys/dev/pci/if_sk.c +++ b/sys/dev/pci/if_sk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sk.c,v 1.165 2013/08/07 01:06:37 bluhm Exp $ */ +/* $OpenBSD: if_sk.c,v 1.166 2013/08/21 05:21:44 dlg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -1740,7 +1740,7 @@ sk_rxeof(struct sk_if_softc *sc_if) if (sk_newbuf(sc_if, cur, NULL, dmamap) == ENOBUFS) { struct mbuf *m0; m0 = m_devget(mtod(m, char *), total_len, ETHER_ALIGN, - ifp, NULL); + ifp); sk_newbuf(sc_if, cur, m, dmamap); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index cb813ccbc8f..658fa5114f1 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vge.c,v 1.56 2013/08/07 01:06:38 bluhm Exp $ */ +/* $OpenBSD: if_vge.c,v 1.57 2013/08/21 05:21:44 dlg Exp $ */ /* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */ /* * Copyright (c) 2004 @@ -1081,7 +1081,7 @@ vge_rxeof(struct vge_softc *sc) } m0 = m_devget(mtod(m, char *), - total_len - ETHER_CRC_LEN, ETHER_ALIGN, ifp, NULL); + total_len - ETHER_CRC_LEN, ETHER_ALIGN, ifp); vge_newbuf(sc, i, m); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index cb460c3ba5d..394451e3baa 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.129 2013/08/07 01:06:38 bluhm Exp $ */ +/* $OpenBSD: if_vr.c,v 1.130 2013/08/21 05:21:44 dlg Exp $ */ /* * Copyright (c) 1997, 1998 @@ -902,7 +902,7 @@ vr_rxeof(struct vr_softc *sc) { struct mbuf *m0; m0 = m_devget(mtod(m, caddr_t), total_len, - ETHER_ALIGN, ifp, NULL); + ETHER_ALIGN, ifp); m_freem(m); if (m0 == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index c79b4c0e514..96762a10723 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wb.c,v 1.52 2013/08/07 01:06:39 bluhm Exp $ */ +/* $OpenBSD: if_wb.c,v 1.53 2013/08/21 05:21:45 dlg Exp $ */ /* * Copyright (c) 1997, 1998 @@ -976,7 +976,7 @@ void wb_rxeof(sc) total_len -= ETHER_CRC_LEN; m = m_devget(cur_rx->wb_buf + sizeof(u_int64_t), total_len, - ETHER_ALIGN, ifp, NULL); + ETHER_ALIGN, ifp); wb_newbuf(sc, cur_rx); if (m == NULL) { ifp->if_ierrors++; diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c index 199626cd7e6..86b70da6b7c 100644 --- a/sys/dev/pcmcia/if_malo.c +++ b/sys/dev/pcmcia/if_malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_malo.c,v 1.73 2011/07/03 15:47:17 matthew Exp $ */ +/* $OpenBSD: if_malo.c,v 1.74 2013/08/21 05:21:45 dlg Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -971,7 +971,7 @@ cmalo_rx(struct malo_softc *sc) /* prepare mbuf */ m = m_devget(sc->sc_data + rxdesc->pkgoffset, - rxdesc->pkglen, ETHER_ALIGN, ifp, NULL); + rxdesc->pkglen, ETHER_ALIGN, ifp); if (m == NULL) { DPRINTF(1, "RX m_devget failed\n"); ifp->if_ierrors++; diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index 43acf4471e2..3d371f1d106 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.59 2013/08/07 01:06:42 bluhm Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.60 2013/08/21 05:21:45 dlg Exp $ */ /* * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org> @@ -1760,7 +1760,7 @@ upgt_rx(struct upgt_softc *sc, uint8_t *data, int pkglen) rxdesc = (struct upgt_lmac_rx_desc *)data; /* create mbuf which is suitable for strict alignment archs */ - m = m_devget(rxdesc->data, pkglen, ETHER_ALIGN, ifp, NULL); + m = m_devget(rxdesc->data, pkglen, ETHER_ALIGN, ifp); if (m == NULL) { DPRINTF(1, "%s: could not create RX mbuf!\n", sc->sc_dev.dv_xname); ifp->if_ierrors++; |