diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2021-02-25 02:48:22 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2021-02-25 02:48:22 +0000 |
commit | e81c643cb074547c4b994c0c0cb2026375874d3b (patch) | |
tree | a34dbd5139146f2ae75aa24fd7de3ba287bb5582 /sys/dev/usb | |
parent | cb17d84caf8abcf80d072c6fbc33a22324e06358 (diff) |
we don't have to cast to caddr_t when calling m_copydata anymore.
the first cut of this diff was made with coccinelle using this spatch:
@rule@
type caddr_t;
expression m, off, len, cp;
@@
-m_copydata(m, off, len, (caddr_t)cp)
+m_copydata(m, off, len, cp)
i had fix it's opinionated idea of formatting by hand though, so
i'm not sure it was worth it.
ok deraadt@ bluhm@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_athn_usb.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_otus.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_rsu.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/if_uath.c | 8 | ||||
-rw-r--r-- | sys/dev/usb/if_urtw.c | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index 281c53c7ff9..771baafcdac 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_usb.c,v 1.59 2020/11/30 16:09:33 krw Exp $ */ +/* $OpenBSD: if_athn_usb.c,v 1.60 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr> @@ -1766,7 +1766,7 @@ athn_usb_swba(struct athn_usb_softc *usc) memset(bcn, 0, sizeof(*bcn)); bcn->vif_idx = 0; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&bcn[1]); + m_copydata(m, 0, m->m_pkthdr.len, &bcn[1]); usbd_setup_xfer(data->xfer, usc->tx_data_pipe, data, data->buf, sizeof(*hdr) + sizeof(*htc) + sizeof(*bcn) + m->m_pkthdr.len, @@ -2377,7 +2377,7 @@ athn_usb_tx(struct athn_softc *sc, struct mbuf *m, struct ieee80211_node *ni) frm = (uint8_t *)&txm[1]; } /* Copy payload. */ - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)frm); + m_copydata(m, 0, m->m_pkthdr.len, frm); frm += m->m_pkthdr.len; m_freem(m); diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 9aa771ecad9..bb220831ffc 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.68 2020/11/30 16:09:33 krw Exp $ */ +/* $OpenBSD: if_otus.c,v 1.69 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -1380,7 +1380,7 @@ otus_tx(struct otus_softc *sc, struct mbuf *m, struct ieee80211_node *ni) #endif xferlen = sizeof (*head) + m->m_pkthdr.len; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&head[1]); + m_copydata(m, 0, m->m_pkthdr.len, &head[1]); m_freem(m); DPRINTFN(5, ("tx queued=%d len=%d mac=0x%04x phy=0x%08x rate=%d\n", diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c index a2d7b48749a..929d8f161d5 100644 --- a/sys/dev/usb/if_rsu.c +++ b/sys/dev/usb/if_rsu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rsu.c,v 1.48 2020/11/30 16:09:33 krw Exp $ */ +/* $OpenBSD: if_rsu.c,v 1.49 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -1609,7 +1609,7 @@ rsu_tx(struct rsu_softc *sc, struct mbuf *m, struct ieee80211_node *ni) #endif xferlen = sizeof(*txd) + m->m_pkthdr.len; - m_copydata(m, 0, m->m_pkthdr.len, (caddr_t)&txd[1]); + m_copydata(m, 0, m->m_pkthdr.len, &txd[1]); m_freem(m); data->pipe = pipe; diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index e75546ba901..ae8ccb49c76 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.86 2020/12/12 11:48:54 jan Exp $ */ +/* $OpenBSD: if_uath.c,v 1.87 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2006 @@ -1398,14 +1398,14 @@ uath_tx_data(struct uath_softc *sc, struct mbuf *m0, struct ieee80211_node *ni) *frm++ = (iv >> 16) & 0xff; *frm++ = ic->ic_wep_txkey << 6; - m_copydata(m0, sizeof (struct ieee80211_frame), - m0->m_pkthdr.len - sizeof (struct ieee80211_frame), frm); + m_copydata(m0, sizeof(struct ieee80211_frame), + m0->m_pkthdr.len - sizeof(struct ieee80211_frame), frm); paylen += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN; xferlen += IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN; totlen = xferlen + IEEE80211_WEP_CRCLEN; } else { - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)(desc + 1)); + m_copydata(m0, 0, m0->m_pkthdr.len, desc + 1); totlen = xferlen; } diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 4e9bfb114bc..996f9122b8f 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtw.c,v 1.69 2020/07/10 13:22:21 patrick Exp $ */ +/* $OpenBSD: if_urtw.c,v 1.70 2021/02/25 02:48:20 dlg Exp $ */ /*- * Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org> @@ -2649,10 +2649,10 @@ urtw_tx_start(struct urtw_softc *sc, struct ieee80211_node *ni, struct mbuf *m0, data->buf[8] = 3; /* CW minimum */ data->buf[8] |= (7 << 4); /* CW maximum */ data->buf[9] |= 11; /* retry limitation */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[12]); + m_copydata(m0, 0, m0->m_pkthdr.len, &data->buf[12]); } else { data->buf[21] |= 11; /* retry limitation */ - m_copydata(m0, 0, m0->m_pkthdr.len, (uint8_t *)&data->buf[32]); + m_copydata(m0, 0, m0->m_pkthdr.len, &data->buf[32]); } data->ni = ni; |