bzero -> memset

This commit is contained in:
thorpej 2001-07-07 16:46:34 +00:00
parent 80f54c0005
commit 51e70f6731
8 changed files with 35 additions and 35 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hifn7751.c,v 1.3 2001/07/07 16:38:36 thorpej Exp $ */
/* $NetBSD: hifn7751.c,v 1.4 2001/07/07 16:46:34 thorpej Exp $ */
/* $OpenBSD: hifn7751.c,v 1.47 2000/10/11 13:15:41 itojun Exp $ */
/*
@ -217,7 +217,7 @@ hifn_attach(parent, self, aux)
goto fail_io1;
}
sc->sc_dma = (struct hifn_dma *)kva;
bzero(sc->sc_dma, sizeof(*sc->sc_dma));
memset(sc->sc_dma, 0, sizeof(*sc->sc_dma));
hifn_reset_board(sc);
@ -858,7 +858,7 @@ hifn_write_command(cmd, buf)
}
if ((base_cmd->masks & (HIFN_BASE_CMD_MAC | HIFN_BASE_CMD_CRYPT)) == 0) {
bzero(buf_pos, 8);
memset(buf_pos, 0, 8);
buf_pos += 8;
}
@ -1219,7 +1219,7 @@ hifn_freesession(tid)
if (session >= sc->sc_maxses)
return (EINVAL);
bzero(&sc->sc_sessions[session], sizeof(sc->sc_sessions[session]));
memset(&sc->sc_sessions[session], 0, sizeof(sc->sc_sessions[session]));
return (0);
}
@ -1256,7 +1256,7 @@ hifn_process(crp)
err = ENOMEM;
goto errout;
}
bzero(cmd, sizeof(struct hifn_command));
memset(cmd, 0, sizeof(struct hifn_command));
if (crp->crp_flags & CRYPTO_F_IMBUF) {
cmd->src_m = (struct mbuf *)crp->crp_buf;
@ -1363,7 +1363,7 @@ hifn_process(crp)
cmd->mac_masks |= HIFN_MAC_CMD_NEW_KEY;
memcpy(cmd->mac, maccrd->crd_key,
maccrd->crd_klen >> 3);
bzero(cmd->mac + (maccrd->crd_klen >> 3),
memset(cmd->mac + (maccrd->crd_klen >> 3), 0,
HIFN_MAC_KEY_LENGTH - (maccrd->crd_klen >> 3));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_de.c,v 1.100 2001/07/07 16:40:23 thorpej Exp $ */
/* $NetBSD: if_de.c,v 1.101 2001/07/07 16:46:34 thorpej Exp $ */
/*-
* Copyright (c) 1994-1997 Matt Thomas (matt@3am-software.com)
@ -3193,7 +3193,7 @@ tulip_addr_filter(
* go into hash perfect mode (512 bit multicast
* hash and one perfect hardware).
*/
bzero(sc->tulip_setupdata, sizeof(sc->tulip_setupdata));
memset(sc->tulip_setupdata, 0, sizeof(sc->tulip_setupdata));
ETHER_FIRST_MULTI(step, TULIP_ETHERCOM(sc), enm);
while (enm != NULL) {
if (bcmp(enm->enm_addrlo, enm->enm_addrhi, 6) == 0) {
@ -5325,7 +5325,7 @@ tulip_initring(
ri->ri_max = ndescs;
ri->ri_first = descs;
ri->ri_last = ri->ri_first + ri->ri_max;
bzero((caddr_t) ri->ri_first, sizeof(ri->ri_first[0]) * ri->ri_max);
memset((caddr_t) ri->ri_first, 0, sizeof(ri->ri_first[0]) * ri->ri_max);
ri->ri_last[-1].d_flag = TULIP_DFLAG_ENDRING;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_lmc.c,v 1.11 2001/07/07 16:37:38 thorpej Exp $ */
/* $NetBSD: if_lmc.c,v 1.12 2001/07/07 16:46:35 thorpej Exp $ */
/*-
* Copyright (c) 1997-1999 LAN Media Corporation (LMC)
@ -1435,6 +1435,6 @@ lmc_initring(lmc_softc_t * const sc, lmc_ringinfo_t * const ri,
ri->ri_max = ndescs;
ri->ri_first = descs;
ri->ri_last = ri->ri_first + ri->ri_max;
bzero((caddr_t) ri->ri_first, sizeof(ri->ri_first[0]) * ri->ri_max);
memset((caddr_t) ri->ri_first, 0, sizeof(ri->ri_first[0]) * ri->ri_max);
ri->ri_last[-1].d_flag = TULIP_DFLAG_ENDRING;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ti.c,v 1.38 2001/07/07 16:40:24 thorpej Exp $ */
/* $NetBSD: if_ti.c,v 1.39 2001/07/07 16:46:35 thorpej Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@ -962,7 +962,7 @@ static void ti_free_rx_ring_std(sc)
bus_dmamap_destroy(sc->sc_dmat, sc->std_dmamap[i]);
sc->std_dmamap[i] = 0;
}
bzero((char *)&sc->ti_rdata->ti_rx_std_ring[i],
memset((char *)&sc->ti_rdata->ti_rx_std_ring[i], 0,
sizeof(struct ti_rx_desc));
}
@ -996,7 +996,7 @@ static void ti_free_rx_ring_jumbo(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],
memset((char *)&sc->ti_rdata->ti_rx_jumbo_ring[i], 0,
sizeof(struct ti_rx_desc));
}
@ -1033,7 +1033,7 @@ static void ti_free_rx_ring_mini(sc)
bus_dmamap_destroy(sc->sc_dmat, sc->mini_dmamap[i]);
sc->mini_dmamap[i] = 0;
}
bzero((char *)&sc->ti_rdata->ti_rx_mini_ring[i],
memset((char *)&sc->ti_rdata->ti_rx_mini_ring[i], 0,
sizeof(struct ti_rx_desc));
}
@ -1059,7 +1059,7 @@ static void ti_free_tx_ring(sc)
link);
sc->txdma[i] = 0;
}
bzero((char *)&sc->ti_rdata->ti_tx_ring[i],
memset((char *)&sc->ti_rdata->ti_tx_ring[i], 0,
sizeof(struct ti_tx_desc));
}
@ -1552,7 +1552,7 @@ static int ti_gibinit(sc)
sc->ti_tx_ring_nic =
(struct ti_tx_desc *)(sc->ti_vhandle + TI_WINDOW);
}
bzero((char *)sc->ti_rdata->ti_tx_ring,
memset((char *)sc->ti_rdata->ti_tx_ring, 0,
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)
@ -1815,7 +1815,7 @@ static void ti_attach(parent, self, aux)
sc->info_dmaaddr = sc->info_dmamap->dm_segs[0].ds_addr;
bzero(sc->ti_rdata, sizeof(struct ti_ring_data));
memset(sc->ti_rdata, 0, sizeof(struct ti_ring_data));
/* Try to allocate memory for jumbo buffers. */
if (ti_alloc_jumbo_mem(sc)) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tl.c,v 1.41 2001/07/07 16:40:24 thorpej Exp $ */
/* $NetBSD: if_tl.c,v 1.42 2001/07/07 16:46:35 thorpej Exp $ */
/* XXX ALTQ XXX */
@ -631,7 +631,7 @@ static int tl_init(sc)
splx(s);
return ENOMEM;
}
bzero(nullbuf, ETHER_MIN_TX);
memset(nullbuf, 0, ETHER_MIN_TX);
/* set media */
mii_mediachg(&sc->tl_mii);
@ -1252,7 +1252,7 @@ txloop:
* and size of the mbuf.
*/
tbdinit:
bzero(Tx, sizeof(struct Tx_list));
memset(Tx, 0, sizeof(struct Tx_list));
Tx->m = mb_head;
size = 0;
for (m = mb_head, segment = 0; m != NULL ; m = m->m_next) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: isp_pci.c,v 1.69 2001/06/14 19:54:07 mjacob Exp $ */
/* $NetBSD: isp_pci.c,v 1.70 2001/07/07 16:46:35 thorpej Exp $ */
/*
* This driver, which is contained in NetBSD in the files:
*
@ -361,7 +361,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, sizeof (sdparam));
memset(isp->isp_param, 0, sizeof (sdparam));
}
#endif
#ifndef ISP_DISABLE_1080_SUPPORT
@ -373,7 +373,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, sizeof (sdparam));
memset(isp->isp_param, 0, sizeof (sdparam));
pcs->pci_poff[DMA_BLOCK >> _BLK_REG_SHFT] =
ISP1080_DMA_REGS_OFF;
}
@ -386,7 +386,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, 2 * sizeof (sdparam));
memset(isp->isp_param, 0, 2 * sizeof (sdparam));
pcs->pci_poff[DMA_BLOCK >> _BLK_REG_SHFT] =
ISP1080_DMA_REGS_OFF;
}
@ -399,7 +399,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, 2 * sizeof (sdparam));
memset(isp->isp_param, 0, 2 * sizeof (sdparam));
pcs->pci_poff[DMA_BLOCK >> _BLK_REG_SHFT] =
ISP1080_DMA_REGS_OFF;
}
@ -414,7 +414,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, 2 * sizeof (sdparam));
memset(isp->isp_param, 0, 2 * sizeof (sdparam));
pcs->pci_poff[DMA_BLOCK >> _BLK_REG_SHFT] =
ISP1080_DMA_REGS_OFF;
}
@ -428,7 +428,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, sizeof (fcparam));
memset(isp->isp_param, 0, sizeof (fcparam));
pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] =
PCI_MBOX_REGS2100_OFF;
if (rev < 3) {
@ -451,7 +451,7 @@ isp_pci_attach(struct device *parent, struct device *self, void *aux)
printf(nomem, isp->isp_name);
return;
}
bzero(isp->isp_param, sizeof (fcparam));
memset(isp->isp_param, 0, sizeof (fcparam));
pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] =
PCI_MBOX_REGS2100_OFF;
data = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_CLASS_REG);
@ -720,7 +720,7 @@ isp_pci_mbxdma(struct ispsoftc *isp)
isp_prt(isp, ISP_LOGERR, "cannot malloc xflist array");
return (1);
}
bzero(isp->isp_xflist, len);
memset(isp->isp_xflist, 0, len);
len = isp->isp_maxcmds * sizeof (bus_dmamap_t);
pcs->pci_xfer_dmap = (bus_dmamap_t *) malloc(len, M_DEVBUF, M_WAITOK);
if (pcs->pci_xfer_dmap == NULL) {
@ -911,7 +911,7 @@ isp_pci_dmasetup(struct ispsoftc *isp, struct scsipi_xfer *xs, ispreq_t *rq,
return (CMD_EAGAIN);
}
rq->req_header.rqs_entry_count++;
bzero((void *)crq, sizeof (*crq));
memset((void *)crq, 0, sizeof (*crq));
crq->req_header.rqs_entry_count = 1;
crq->req_header.rqs_entry_type = RQSTYPE_DATASEG;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tga.c,v 1.32 2001/06/24 01:11:08 elric Exp $ */
/* $NetBSD: tga.c,v 1.33 2001/07/07 16:46:35 thorpej Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -376,7 +376,7 @@ tgaattach(parent, self, aux)
} else {
sc->sc_dc = (struct tga_devconfig *)
malloc(sizeof(struct tga_devconfig), M_DEVBUF, M_WAITOK);
bzero(sc->sc_dc, sizeof(struct tga_devconfig));
memset(sc->sc_dc, 0, sizeof(struct tga_devconfig));
tga_getdevconfig(pa->pa_memt, pa->pa_pc, pa->pa_tag,
sc->sc_dc);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: yds.c,v 1.5 2001/05/21 23:55:04 minoura Exp $ */
/* $NetBSD: yds.c,v 1.6 2001/07/07 16:46:35 thorpej Exp $ */
/*
* Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@ -436,7 +436,7 @@ yds_allocate_slots(sc)
DPRINTF(("mp:%p, DMA addr:%p\n",
mp, (void *)sc->sc_ctrldata.map->dm_segs[0].ds_addr));
bzero(mp, memsize);
memset(mp, 0, memsize);
/* Work space */
cb = 0;