diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2011-06-21 16:52:46 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2011-06-21 16:52:46 +0000 |
commit | b50edea001b4bd82ae333fbd20b35c63b80e60cc (patch) | |
tree | 7dddd5684988725e72e04c87bb6afe039543d3c3 /sys/dev/ic | |
parent | 065e08b541aea43b271d4bb149d66aebf544153a (diff) |
remove some unnecessary casts. ok blambert deraadt kettenis matthew
Diffstat (limited to 'sys/dev/ic')
-rw-r--r-- | sys/dev/ic/dc.c | 16 | ||||
-rw-r--r-- | sys/dev/ic/if_wi.c | 90 | ||||
-rw-r--r-- | sys/dev/ic/if_wireg.h | 4 | ||||
-rw-r--r-- | sys/dev/ic/mtd8xx.c | 8 | ||||
-rw-r--r-- | sys/dev/ic/ncr5380sbc.c | 4 | ||||
-rw-r--r-- | sys/dev/ic/pgt.c | 7 | ||||
-rw-r--r-- | sys/dev/ic/rtl81x9.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/ti.c | 14 | ||||
-rw-r--r-- | sys/dev/ic/xl.c | 18 |
9 files changed, 75 insertions, 92 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c index 32d84510a0e..ffb4b9db446 100644 --- a/sys/dev/ic/dc.c +++ b/sys/dev/ic/dc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dc.c,v 1.122 2011/03/05 13:39:26 kettenis Exp $ */ +/* $OpenBSD: dc.c,v 1.123 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -749,7 +749,7 @@ dc_miibus_writereg(struct device *self, int phy, int reg, int data) struct dc_mii_frame frame; int i, phy_reg; - bzero((char *)&frame, sizeof(frame)); + bzero(&frame, sizeof(frame)); if (DC_IS_ADMTEK(sc) && phy != DC_ADMTEK_PHYADDR) return; @@ -903,7 +903,7 @@ dc_setfilt_21143(struct dc_softc *sc) sc->dc_cdata.dc_tx_cnt++; sframe = &sc->dc_ldata->dc_tx_list[i]; sp = &sc->dc_ldata->dc_sbuf[0]; - bzero((char *)sp, DC_SFRAME_LEN); + bzero(sp, DC_SFRAME_LEN); sframe->dc_data = htole32(sc->sc_listmap->dm_segs[0].ds_addr + offsetof(struct dc_list_data, dc_sbuf)); @@ -1126,7 +1126,7 @@ dc_setfilt_xircom(struct dc_softc *sc) sc->dc_cdata.dc_tx_cnt++; sframe = &sc->dc_ldata->dc_tx_list[i]; sp = &sc->dc_ldata->dc_sbuf[0]; - bzero((char *)sp, DC_SFRAME_LEN); + bzero(sp, DC_SFRAME_LEN); sframe->dc_data = htole32(sc->sc_listmap->dm_segs[0].ds_addr + offsetof(struct dc_list_data, dc_sbuf)); @@ -1934,7 +1934,7 @@ dc_newbuf(struct dc_softc *sc, int i, struct mbuf *m) * 82c169 chips. */ if (sc->dc_flags & DC_PNIC_RX_BUG_WAR) - bzero((char *)mtod(m_new, char *), m_new->m_len); + bzero(mtod(m_new, char *), m_new->m_len); bus_dmamap_sync(sc->sc_dmat, sc->dc_cdata.dc_rx_chain[i].sd_map, 0, sc->dc_cdata.dc_rx_chain[i].sd_map->dm_mapsize, @@ -3112,8 +3112,7 @@ dc_stop(struct dc_softc *sc, int softonly) sc->dc_cdata.dc_rx_chain[i].sd_mbuf = NULL; } } - bzero((char *)&sc->dc_ldata->dc_rx_list, - sizeof(sc->dc_ldata->dc_rx_list)); + bzero(&sc->dc_ldata->dc_rx_list, sizeof(sc->dc_ldata->dc_rx_list)); /* * Free the TX list buffers. @@ -3136,8 +3135,7 @@ dc_stop(struct dc_softc *sc, int softonly) sc->dc_cdata.dc_tx_chain[i].sd_mbuf = NULL; } } - bzero((char *)&sc->dc_ldata->dc_tx_list, - sizeof(sc->dc_ldata->dc_tx_list)); + bzero(&sc->dc_ldata->dc_tx_list, sizeof(sc->dc_ldata->dc_tx_list)); bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap, 0, sc->sc_listmap->dm_mapsize, diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index 2f24cb973fd..cb97c93abbb 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.149 2010/08/30 20:42:27 deraadt Exp $ */ +/* $OpenBSD: if_wi.c,v 1.150 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -226,8 +226,7 @@ wi_attach(struct wi_softc *sc, struct wi_funcs *funcs) printf(": unable to read station address\n"); return (error); } - bcopy((char *)&mac.wi_mac_addr, (char *)&ic->ic_myaddr, - IEEE80211_ADDR_LEN); + bcopy(&mac.wi_mac_addr, &ic->ic_myaddr, IEEE80211_ADDR_LEN); wi_get_id(sc); printf("address %s", ether_sprintf(ic->ic_myaddr)); @@ -332,7 +331,7 @@ wi_attach(struct wi_softc *sc, struct wi_funcs *funcs) sc->wi_flags |= WI_FLAGS_HAS_WEP; timeout_set(&sc->sc_timo, funcs->f_inquire, sc); - bzero((char *)&sc->wi_stats, sizeof(sc->wi_stats)); + bzero(&sc->wi_stats, sizeof(sc->wi_stats)); /* Find supported rates. */ rates.wi_type = WI_RID_DATA_RATES; @@ -730,12 +729,12 @@ wi_rxeof(struct wi_softc *sc) m->m_pkthdr.len = m->m_len = letoh16(rx_frame.wi_dat_len) + WI_SNAPHDR_LEN; - bcopy((char *)&rx_frame.wi_dst_addr, - (char *)&eh->ether_dhost, ETHER_ADDR_LEN); - bcopy((char *)&rx_frame.wi_src_addr, - (char *)&eh->ether_shost, ETHER_ADDR_LEN); - bcopy((char *)&rx_frame.wi_type, - (char *)&eh->ether_type, ETHER_TYPE_LEN); + bcopy(&rx_frame.wi_dst_addr, + &eh->ether_dhost, ETHER_ADDR_LEN); + bcopy(&rx_frame.wi_src_addr, + &eh->ether_shost, ETHER_ADDR_LEN); + bcopy(&rx_frame.wi_type, + &eh->ether_type, ETHER_TYPE_LEN); if (wi_read_data(sc, id, WI_802_11_OFFSET, mtod(m, caddr_t) + sizeof(struct ether_header), @@ -1402,7 +1401,7 @@ wi_setmulti(struct wi_softc *sc) ifp = &sc->sc_ic.ic_if; - bzero((char *)&mcast, sizeof(mcast)); + bzero(&mcast, sizeof(mcast)); mcast.wi_type = WI_RID_MCAST_LIST; mcast.wi_len = ((ETHER_ADDR_LEN / 2) * 16) + 1; @@ -1416,7 +1415,7 @@ allmulti: ETHER_FIRST_MULTI(step, &sc->sc_ic.ic_ac, enm); while (enm != NULL) { if (i >= 16) { - bzero((char *)&mcast, sizeof(mcast)); + bzero(&mcast, sizeof(mcast)); break; } @@ -1424,8 +1423,7 @@ allmulti: ifp->if_flags |= IFF_ALLMULTI; goto allmulti; } - bcopy(enm->enm_addrlo, (char *)&mcast.wi_mcast[i], - ETHER_ADDR_LEN); + bcopy(enm->enm_addrlo, &mcast.wi_mcast[i], ETHER_ADDR_LEN); i++; ETHER_NEXT_MULTI(step, enm); } @@ -1446,10 +1444,8 @@ wi_setdef(struct wi_softc *sc, struct wi_req *wreq) switch(wreq->wi_type) { case WI_RID_MAC_NODE: - bcopy((char *)&wreq->wi_val, LLADDR(ifp->if_sadl), - ETHER_ADDR_LEN); - bcopy((char *)&wreq->wi_val, (char *)&sc->sc_ic.ic_myaddr, - ETHER_ADDR_LEN); + bcopy(&wreq->wi_val, LLADDR(ifp->if_sadl), ETHER_ADDR_LEN); + bcopy(&wreq->wi_val, &sc->sc_ic.ic_myaddr, ETHER_ADDR_LEN); break; case WI_RID_PORTTYPE: error = wi_sync_media(sc, letoh16(wreq->wi_val[0]), @@ -1515,8 +1511,7 @@ wi_setdef(struct wi_softc *sc, struct wi_req *wreq) sc->wi_tx_key = letoh16(wreq->wi_val[0]); break; case WI_RID_DEFLT_CRYPT_KEYS: - bcopy((char *)wreq, (char *)&sc->wi_keys, - sizeof(struct wi_ltv_keys)); + bcopy(wreq, &sc->wi_keys, sizeof(struct wi_ltv_keys)); break; case WI_FRID_CRYPTO_ALG: switch (letoh16(wreq->wi_val[0])) { @@ -1628,7 +1623,7 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data) switch (wreq->wi_type) { case WI_RID_IFACE_STATS: /* XXX native byte order */ - bcopy((char *)&sc->wi_stats, (char *)&wreq->wi_val, + bcopy(&sc->wi_stats, &wreq->wi_val, sizeof(sc->wi_stats)); wreq->wi_len = (sizeof(sc->wi_stats) / 2) + 1; break; @@ -1637,7 +1632,7 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data) if (suser(p, 0)) bzero(wreq, sizeof(struct wi_ltv_keys)); else - bcopy((char *)&sc->wi_keys, wreq, + bcopy(&sc->wi_keys, wreq, sizeof(struct wi_ltv_keys)); break; case WI_RID_PROCFRAME: @@ -2161,10 +2156,8 @@ wi_init_io(struct wi_softc *sc) /* Set our MAC address. */ mac.wi_len = 4; mac.wi_type = WI_RID_MAC_NODE; - bcopy(LLADDR(ifp->if_sadl), - (char *)&sc->sc_ic.ic_myaddr, ETHER_ADDR_LEN); - bcopy((char *)&sc->sc_ic.ic_myaddr, - (char *)&mac.wi_mac_addr, ETHER_ADDR_LEN); + bcopy(LLADDR(ifp->if_sadl), &sc->sc_ic.ic_myaddr, ETHER_ADDR_LEN); + bcopy(&sc->sc_ic.ic_myaddr, &mac.wi_mac_addr, ETHER_ADDR_LEN); wi_write_record(sc, (struct wi_ltv_gen *)&mac); /* @@ -2268,8 +2261,8 @@ wi_do_hostencrypt(struct wi_softc *sc, caddr_t buf, int len) key[2] = sc->wi_icv; klen = letoh16(sc->wi_keys.wi_keys[sc->wi_tx_key].wi_keylen); - bcopy((char *)&sc->wi_keys.wi_keys[sc->wi_tx_key].wi_keydat, - (char *)key + IEEE80211_WEP_IVLEN, klen); + bcopy(&sc->wi_keys.wi_keys[sc->wi_tx_key].wi_keydat, + key + IEEE80211_WEP_IVLEN, klen); klen = (klen > IEEE80211_WEP_KEYLEN) ? RC4KEYLEN : RC4KEYLEN / 2; /* rc4 keysetup */ @@ -2320,8 +2313,8 @@ wi_do_hostdecrypt(struct wi_softc *sc, caddr_t buf, int len) dat += 4; klen = letoh16(sc->wi_keys.wi_keys[kid].wi_keylen); - bcopy((char *)&sc->wi_keys.wi_keys[kid].wi_keydat, - (char *)key + IEEE80211_WEP_IVLEN, klen); + bcopy(&sc->wi_keys.wi_keys[kid].wi_keydat, + key + IEEE80211_WEP_IVLEN, klen); klen = (klen > IEEE80211_WEP_KEYLEN) ? RC4KEYLEN : RC4KEYLEN / 2; /* rc4 keysetup */ @@ -2371,7 +2364,7 @@ nextpkt: if (m0 == NULL) return; - bzero((char *)&tx_frame, sizeof(tx_frame)); + bzero(&tx_frame, sizeof(tx_frame)); tx_frame.wi_frame_ctl = htole16(WI_FTYPE_DATA | WI_STYPE_DATA); id = sc->wi_tx_data_id; eh = mtod(m0, struct ether_header *); @@ -2397,33 +2390,31 @@ nextpkt: eh->ether_type == htons(ETHERTYPE_ARP) || eh->ether_type == htons(ETHERTYPE_REVARP) || eh->ether_type == htons(ETHERTYPE_IPV6)) { - bcopy((char *)&eh->ether_dhost, - (char *)&tx_frame.wi_addr1, ETHER_ADDR_LEN); + bcopy(&eh->ether_dhost, + &tx_frame.wi_addr1, ETHER_ADDR_LEN); if (sc->wi_ptype == WI_PORTTYPE_HOSTAP) { tx_frame.wi_tx_ctl = htole16(WI_ENC_TX_MGMT); /* XXX */ tx_frame.wi_frame_ctl |= htole16(WI_FCTL_FROMDS); - bcopy((char *)&sc->sc_ic.ic_myaddr, - (char *)&tx_frame.wi_addr2, ETHER_ADDR_LEN); - bcopy((char *)&eh->ether_shost, - (char *)&tx_frame.wi_addr3, ETHER_ADDR_LEN); + bcopy(&sc->sc_ic.ic_myaddr, + &tx_frame.wi_addr2, ETHER_ADDR_LEN); + bcopy(&eh->ether_shost, + &tx_frame.wi_addr3, ETHER_ADDR_LEN); if (sc->wi_use_wep) hostencrypt = 1; } else if (sc->wi_ptype == WI_PORTTYPE_BSS && sc->wi_use_wep && sc->wi_crypto_algorithm != WI_CRYPTO_FIRMWARE_WEP) { tx_frame.wi_tx_ctl = htole16(WI_ENC_TX_MGMT); /* XXX */ tx_frame.wi_frame_ctl |= htole16(WI_FCTL_TODS); - bcopy((char *)&sc->sc_ic.ic_myaddr, - (char *)&tx_frame.wi_addr2, ETHER_ADDR_LEN); - bcopy((char *)&eh->ether_dhost, - (char *)&tx_frame.wi_addr3, ETHER_ADDR_LEN); + bcopy(&sc->sc_ic.ic_myaddr, + &tx_frame.wi_addr2, ETHER_ADDR_LEN); + bcopy(&eh->ether_dhost, + &tx_frame.wi_addr3, ETHER_ADDR_LEN); hostencrypt = 1; } else - bcopy((char *)&eh->ether_shost, - (char *)&tx_frame.wi_addr2, ETHER_ADDR_LEN); - bcopy((char *)&eh->ether_dhost, - (char *)&tx_frame.wi_dst_addr, ETHER_ADDR_LEN); - bcopy((char *)&eh->ether_shost, - (char *)&tx_frame.wi_src_addr, ETHER_ADDR_LEN); + bcopy(&eh->ether_shost, + &tx_frame.wi_addr2, ETHER_ADDR_LEN); + bcopy(&eh->ether_dhost, &tx_frame.wi_dst_addr, ETHER_ADDR_LEN); + bcopy(&eh->ether_shost, &tx_frame.wi_src_addr, ETHER_ADDR_LEN); tx_frame.wi_dat_len = m0->m_pkthdr.len - WI_SNAPHDR_LEN; tx_frame.wi_dat[0] = htons(WI_SNAP_WORD0); @@ -2526,11 +2517,10 @@ wi_mgmt_xmit(struct wi_softc *sc, caddr_t data, int len) hdr = (struct wi_80211_hdr *)data; dptr = data + sizeof(struct wi_80211_hdr); - bzero((char *)&tx_frame, sizeof(tx_frame)); + bzero(&tx_frame, sizeof(tx_frame)); id = sc->wi_tx_mgmt_id; - bcopy((char *)hdr, (char *)&tx_frame.wi_frame_ctl, - sizeof(struct wi_80211_hdr)); + bcopy(hdr, &tx_frame.wi_frame_ctl, sizeof(struct wi_80211_hdr)); tx_frame.wi_tx_ctl = htole16(WI_ENC_TX_MGMT); tx_frame.wi_dat_len = len - sizeof(struct wi_80211_hdr); diff --git a/sys/dev/ic/if_wireg.h b/sys/dev/ic/if_wireg.h index 728153d4d89..330fa4b5895 100644 --- a/sys/dev/ic/if_wireg.h +++ b/sys/dev/ic/if_wireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wireg.h,v 1.39 2008/02/03 15:04:37 kettenis Exp $ */ +/* $OpenBSD: if_wireg.h,v 1.40 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -356,7 +356,7 @@ struct wi_ltv_str { int l; \ \ l = (str.i_len + 1) & ~0x1; \ - bzero((char *)&s, sizeof(s)); \ + bzero(&s, sizeof(s)); \ s.wi_len = (l / 2) + 2; \ s.wi_type = recno; \ s.wi_str[0] = htole16(str.i_len); \ diff --git a/sys/dev/ic/mtd8xx.c b/sys/dev/ic/mtd8xx.c index 2d689ae4c98..5b99f8f364c 100644 --- a/sys/dev/ic/mtd8xx.c +++ b/sys/dev/ic/mtd8xx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtd8xx.c,v 1.17 2010/05/19 15:27:35 oga Exp $ */ +/* $OpenBSD: mtd8xx.c,v 1.18 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 2003 Oleg Safiullin <form@pdp11.org.ru> @@ -772,8 +772,7 @@ mtd_stop(struct ifnet *ifp) sc->mtd_cdata.mtd_rx_chain[i].sd_mbuf = NULL; } } - bzero((char *)&sc->mtd_ldata->mtd_rx_list, - sizeof(sc->mtd_ldata->mtd_rx_list)); + bzero(&sc->mtd_ldata->mtd_rx_list, sizeof(sc->mtd_ldata->mtd_rx_list)); /* * Free the TX list buffers. @@ -792,8 +791,7 @@ mtd_stop(struct ifnet *ifp) } } - bzero((char *)&sc->mtd_ldata->mtd_tx_list, - sizeof(sc->mtd_ldata->mtd_tx_list)); + bzero(&sc->mtd_ldata->mtd_tx_list, sizeof(sc->mtd_ldata->mtd_tx_list)); } diff --git a/sys/dev/ic/ncr5380sbc.c b/sys/dev/ic/ncr5380sbc.c index 670feb2f1c9..723df2814d8 100644 --- a/sys/dev/ic/ncr5380sbc.c +++ b/sys/dev/ic/ncr5380sbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ncr5380sbc.c,v 1.26 2010/06/26 23:24:44 guenther Exp $ */ +/* $OpenBSD: ncr5380sbc.c,v 1.27 2011/06/21 16:52:45 tedu Exp $ */ /* $NetBSD: ncr5380sbc.c,v 1.13 1996/10/13 01:37:25 christos Exp $ */ /* @@ -2496,7 +2496,7 @@ void ncr5380_clear_trace() { ncr5380_traceidx = 0; - bzero((char *) ncr5380_tracebuf, sizeof(ncr5380_tracebuf)); + bzero(ncr5380_tracebuf, sizeof(ncr5380_tracebuf)); } void diff --git a/sys/dev/ic/pgt.c b/sys/dev/ic/pgt.c index f425d4385d9..aef2aba4690 100644 --- a/sys/dev/ic/pgt.c +++ b/sys/dev/ic/pgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pgt.c,v 1.66 2010/09/20 07:40:41 deraadt Exp $ */ +/* $OpenBSD: pgt.c,v 1.67 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org> @@ -1684,10 +1684,9 @@ pgt_mgmt_request(struct pgt_softc *sc, struct pgt_mgmt_desc *pmd) pmf->pmf_size = htobe32(pmd->pmd_len); /* "set" and "retrieve" operations both send data */ if (pmd->pmd_sendbuf != NULL) - memcpy((char *)pmf + sizeof(*pmf), pmd->pmd_sendbuf, - pmd->pmd_len); + memcpy(pmf + 1, pmd->pmd_sendbuf, pmd->pmd_len); else - bzero((char *)pmf + sizeof(*pmf), pmd->pmd_len); + bzero(pmf + 1, pmd->pmd_len); pmd->pmd_error = EINPROGRESS; TAILQ_INSERT_TAIL(&sc->sc_mgmtinprog, pmd, pmd_link); if (sc->sc_debug & SC_DEBUG_MGMT) diff --git a/sys/dev/ic/rtl81x9.c b/sys/dev/ic/rtl81x9.c index c1bf37011af..606d7e8ff4b 100644 --- a/sys/dev/ic/rtl81x9.c +++ b/sys/dev/ic/rtl81x9.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtl81x9.c,v 1.74 2010/09/07 16:21:42 deraadt Exp $ */ +/* $OpenBSD: rtl81x9.c,v 1.75 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1313,7 +1313,7 @@ rl_miibus_readreg(struct device *self, int phy, int reg) return (CSR_READ_2(sc, rl8139_reg)); } - bzero((char *)&frame, sizeof(frame)); + bzero(&frame, sizeof(frame)); frame.mii_phyaddr = phy; frame.mii_regaddr = reg; @@ -1357,7 +1357,7 @@ rl_miibus_writereg(struct device *self, int phy, int reg, int val) return; } - bzero((char *)&frame, sizeof(frame)); + bzero(&frame, sizeof(frame)); frame.mii_phyaddr = phy; frame.mii_regaddr = reg; frame.mii_data = val; diff --git a/sys/dev/ic/ti.c b/sys/dev/ic/ti.c index e783f52c9c7..85e3a2af603 100644 --- a/sys/dev/ic/ti.c +++ b/sys/dev/ic/ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ti.c,v 1.3 2010/09/20 07:40:41 deraadt Exp $ */ +/* $OpenBSD: ti.c,v 1.4 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -954,7 +954,7 @@ ti_free_rx_ring_std(struct ti_softc *sc) sc->ti_cdata.ti_rx_std_map[i]); sc->ti_cdata.ti_rx_std_map[i] = 0; } - bzero((char *)&sc->ti_rdata->ti_rx_std_ring[i], + bzero(&sc->ti_rdata->ti_rx_std_ring[i], sizeof(struct ti_rx_desc)); } } @@ -986,7 +986,7 @@ ti_free_rx_ring_jumbo(struct ti_softc *sc) m_freem(sc->ti_cdata.ti_rx_jumbo_chain[i]); sc->ti_cdata.ti_rx_jumbo_chain[i] = NULL; } - bzero((char *)&sc->ti_rdata->ti_rx_jumbo_ring[i], + bzero(&sc->ti_rdata->ti_rx_jumbo_ring[i], sizeof(struct ti_rx_desc)); } } @@ -1020,7 +1020,7 @@ ti_free_rx_ring_mini(struct ti_softc *sc) sc->ti_cdata.ti_rx_mini_map[i]); sc->ti_cdata.ti_rx_mini_map[i] = 0; } - bzero((char *)&sc->ti_rdata->ti_rx_mini_ring[i], + bzero(&sc->ti_rdata->ti_rx_mini_ring[i], sizeof(struct ti_rx_desc)); } } @@ -1042,7 +1042,7 @@ ti_free_tx_ring(struct ti_softc *sc) sc->ti_cdata.ti_tx_map[i], link); sc->ti_cdata.ti_tx_map[i] = 0; } - bzero((char *)&sc->ti_rdata->ti_tx_ring[i], + bzero(&sc->ti_rdata->ti_tx_ring[i], sizeof(struct ti_tx_desc)); } @@ -1199,7 +1199,7 @@ ti_iff(struct ti_softc *sc) if (mc == NULL) panic("ti_iff"); - bcopy(enm->enm_addrlo, (char *)&mc->mc_addr, + bcopy(enm->enm_addrlo, &mc->mc_addr, ETHER_ADDR_LEN); SLIST_INSERT_HEAD(&sc->ti_mc_listhead, mc, mc_entries); @@ -1510,7 +1510,7 @@ ti_gibinit(struct ti_softc *sc) * a Tigon 1 chip. */ CSR_WRITE_4(sc, TI_WINBASE, TI_TX_RING_BASE); - bzero((char *)sc->ti_rdata->ti_tx_ring, + bzero(sc->ti_rdata->ti_tx_ring, TI_TX_RING_CNT * sizeof(struct ti_tx_desc)); rcb = &sc->ti_rdata->ti_info.ti_tx_rcb; if (sc->ti_hwrev == TI_HWREV_TIGON) diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index d79d6312071..912db1867fa 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.101 2011/04/17 20:52:43 stsp Exp $ */ +/* $OpenBSD: xl.c,v 1.102 2011/06/21 16:52:45 tedu Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -450,7 +450,7 @@ xl_miibus_readreg(struct device *self, int phy, int reg) if (!(sc->xl_flags & XL_FLAG_PHYOK) && phy != 24) return (0); - bzero((char *)&frame, sizeof(frame)); + bzero(&frame, sizeof(frame)); frame.mii_phyaddr = phy; frame.mii_regaddr = reg; @@ -468,7 +468,7 @@ xl_miibus_writereg(struct device *self, int phy, int reg, int data) if (!(sc->xl_flags & XL_FLAG_PHYOK) && phy != 24) return; - bzero((char *)&frame, sizeof(frame)); + bzero(&frame, sizeof(frame)); frame.mii_phyaddr = phy; frame.mii_regaddr = reg; @@ -1049,7 +1049,7 @@ xl_list_tx_init_90xB(struct xl_softc *sc) cd->xl_tx_chain[i].xl_prev = &cd->xl_tx_chain[prev]; } - bzero((char *)ld->xl_tx_list, sizeof(struct xl_list) * XL_TX_LIST_CNT); + bzero(ld->xl_tx_list, sizeof(struct xl_list) * XL_TX_LIST_CNT); ld->xl_tx_list[0].xl_status = htole32(XL_TXSTAT_EMPTY); cd->xl_tx_prod = 1; @@ -1533,7 +1533,7 @@ xl_stats_update(void *xsc) int i; struct mii_data *mii = NULL; - bzero((char *)&xl_stats, sizeof(struct xl_stats)); + bzero(&xl_stats, sizeof(struct xl_stats)); sc = xsc; ifp = &sc->sc_arpcom.ac_if; @@ -2308,8 +2308,7 @@ xl_freetxrx(struct xl_softc *sc) sc->xl_cdata.xl_rx_chain[i].xl_mbuf = NULL; } } - bzero((char *)&sc->xl_ldata->xl_rx_list, - sizeof(sc->xl_ldata->xl_rx_list)); + bzero(&sc->xl_ldata->xl_rx_list, sizeof(sc->xl_ldata->xl_rx_list)); /* * Free the TX list buffers. */ @@ -2326,8 +2325,7 @@ xl_freetxrx(struct xl_softc *sc) sc->xl_cdata.xl_tx_chain[i].xl_mbuf = NULL; } } - bzero((char *)&sc->xl_ldata->xl_tx_list, - sizeof(sc->xl_ldata->xl_tx_list)); + bzero(&sc->xl_ldata->xl_tx_list, sizeof(sc->xl_ldata->xl_tx_list)); } /* @@ -2400,7 +2398,7 @@ xl_attach(struct xl_softc *sc) sc->sc_dev.dv_xname); return; } - bcopy(enaddr, (char *)&sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); + bcopy(enaddr, &sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); if (bus_dmamem_alloc(sc->sc_dmat, sizeof(struct xl_list_data), PAGE_SIZE, 0, sc->sc_listseg, 1, &sc->sc_listnseg, |