From: deraadt Date: Fri, 19 Dec 2014 07:23:57 +0000 (+0000) Subject: another handful of bcopy -> memcpy because there is no overlap X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=607c4dea21c137f5b5cbb5e0d3707776b00f1ac5;p=openbsd another handful of bcopy -> memcpy because there is no overlap --- diff --git a/sys/dev/ic/cac.c b/sys/dev/ic/cac.c index af0cc9dc7b0..1aedc02abdc 100644 --- a/sys/dev/ic/cac.c +++ b/sys/dev/ic/cac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cac.c,v 1.53 2014/09/14 14:17:24 jsg Exp $ */ +/* $OpenBSD: cac.c,v 1.54 2014/12/19 07:23:57 deraadt Exp $ */ /* $NetBSD: cac.c,v 1.15 2000/11/08 19:20:35 ad Exp $ */ /* @@ -581,7 +581,7 @@ cac_copy_internal_data(xs, v, size) printf("uio move is not yet supported\n"); else { copy_cnt = MIN(size, xs->datalen); - bcopy(v, xs->data, copy_cnt); + memcpy(xs->data, v, copy_cnt); } } diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c index a5eea693a38..a4d355ec719 100644 --- a/sys/dev/ic/mfi.c +++ b/sys/dev/ic/mfi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfi.c,v 1.157 2014/09/14 14:17:24 jsg Exp $ */ +/* $OpenBSD: mfi.c,v 1.158 2014/12/19 07:23:57 deraadt Exp $ */ /* * Copyright (c) 2006 Marco Peereboom * @@ -1378,7 +1378,7 @@ mfi_do_mgmt(struct mfi_softc *sc, struct mfi_ccb *ccb, uint32_t opc, if (dir != MFI_DATA_NONE) { if (dir == MFI_DATA_OUT) - bcopy(buf, dma_buf, len); + memcpy(dma_buf, buf, len); dcmd->mdf_header.mfh_data_len = len; ccb->ccb_data = dma_buf; ccb->ccb_len = len; @@ -1402,7 +1402,7 @@ mfi_do_mgmt(struct mfi_softc *sc, struct mfi_ccb *ccb, uint32_t opc, } if (dir == MFI_DATA_IN) - bcopy(dma_buf, buf, len); + memcpy(buf, dma_buf, len); rv = 0; done: @@ -2481,7 +2481,7 @@ mfi_pd_scsi_probe(struct scsi_link *link) return (ENXIO); bzero(mbox, sizeof(mbox)); - bcopy(&pl->pd_id, &mbox[0], sizeof(pl->pd_id)); + memcpy(&mbox[0], &pl->pd_id, sizeof(pl->pd_id)); if (mfi_mgmt(sc, MR_DCMD_PD_GET_INFO, MFI_DATA_IN, sizeof(pl->pd_info), &pl->pd_info, mbox)) diff --git a/sys/dev/ic/osiop.c b/sys/dev/ic/osiop.c index 9626df5a262..5c874e6bc19 100644 --- a/sys/dev/ic/osiop.c +++ b/sys/dev/ic/osiop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osiop.c,v 1.49 2014/07/13 23:10:23 deraadt Exp $ */ +/* $OpenBSD: osiop.c,v 1.50 2014/12/19 07:23:57 deraadt Exp $ */ /* $NetBSD: osiop.c,v 1.9 2002/04/05 18:27:54 bouyer Exp $ */ /* @@ -412,7 +412,7 @@ osiop_scsicmd(xs) acb->status = ACB_S_READY; acb->xs = xs; acb->xsflags = xs->flags; - bcopy(xs->cmd, &acb->ds->scsi_cmd, xs->cmdlen); + memcpy(&acb->ds->scsi_cmd, xs->cmd, xs->cmdlen); acb->ds->cmd.count = xs->cmdlen; acb->datalen = 0; #ifdef OSIOP_DEBUG diff --git a/sys/dev/ic/pckbc.c b/sys/dev/ic/pckbc.c index 0f5e98a841f..bbdec9ddb04 100644 --- a/sys/dev/ic/pckbc.c +++ b/sys/dev/ic/pckbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pckbc.c,v 1.42 2014/10/15 15:55:42 uebayasi Exp $ */ +/* $OpenBSD: pckbc.c,v 1.43 2014/12/19 07:23:57 deraadt Exp $ */ /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* @@ -660,7 +660,7 @@ pckbc_poll_cmd(pckbc_tag_t self, pckbc_slot_t slot, u_char *cmd, int len, return (EINVAL); bzero(&nc, sizeof(nc)); - bcopy(cmd, nc.cmd, len); + memcpy(nc.cmd, cmd, len); nc.cmdlen = len; nc.responselen = responselen; nc.flags = (slow ? KBC_CMDFLAG_SLOW : 0); @@ -668,7 +668,7 @@ pckbc_poll_cmd(pckbc_tag_t self, pckbc_slot_t slot, u_char *cmd, int len, pckbc_poll_cmd1(self, slot, &nc); if (nc.status == 0 && respbuf) - bcopy(nc.response, respbuf, responselen); + memcpy(respbuf, nc.response, responselen); return (nc.status); } @@ -883,7 +883,7 @@ pckbc_enqueue_cmd(pckbc_tag_t self, pckbc_slot_t slot, u_char *cmd, int len, return (ENOMEM); bzero(nc, sizeof(*nc)); - bcopy(cmd, nc->cmd, len); + memcpy(nc->cmd, cmd, len); nc->cmdlen = len; nc->responselen = responselen; nc->flags = (sync ? KBC_CMDFLAG_SYNC : 0); @@ -919,7 +919,7 @@ pckbc_enqueue_cmd(pckbc_tag_t self, pckbc_slot_t slot, u_char *cmd, int len, if (sync) { if (respbuf) - bcopy(nc->response, respbuf, responselen); + memcpy(respbuf, nc->response, responselen); TAILQ_INSERT_TAIL(&q->freequeue, nc, next); } diff --git a/sys/dev/ic/qla.c b/sys/dev/ic/qla.c index 2a23a4b6740..30cbe2ce837 100644 --- a/sys/dev/ic/qla.c +++ b/sys/dev/ic/qla.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qla.c,v 1.45 2014/09/14 14:17:24 jsg Exp $ */ +/* $OpenBSD: qla.c,v 1.46 2014/12/19 07:23:57 deraadt Exp $ */ /* * Copyright (c) 2011 David Gwynne @@ -2465,7 +2465,7 @@ qla_read_nvram(struct qla_softc *sc) csum += data[i] >> 8; } - bcopy(data, &sc->sc_nvram, sizeof(sc->sc_nvram)); + memcpy(&sc->sc_nvram, data, sizeof(sc->sc_nvram)); /* id field should be 'ISP ', version should be at least 1 */ if (sc->sc_nvram.id[0] != 'I' || sc->sc_nvram.id[1] != 'S' || sc->sc_nvram.id[2] != 'P' || sc->sc_nvram.id[3] != ' ' || diff --git a/sys/dev/ic/qlw.c b/sys/dev/ic/qlw.c index 6180f1006bb..f56dd754de0 100644 --- a/sys/dev/ic/qlw.c +++ b/sys/dev/ic/qlw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qlw.c,v 1.25 2014/09/14 14:17:24 jsg Exp $ */ +/* $OpenBSD: qlw.c,v 1.26 2014/12/19 07:23:57 deraadt Exp $ */ /* * Copyright (c) 2011 David Gwynne @@ -1517,7 +1517,7 @@ qlw_read_nvram(struct qlw_softc *sc) csum += data[i] >> 8; } - bcopy(data, &sc->sc_nvram, sizeof(sc->sc_nvram)); + memcpy(&sc->sc_nvram, data, sizeof(sc->sc_nvram)); /* id field should be 'ISP ', version should high enough */ if (sc->sc_nvram.id[0] != 'I' || sc->sc_nvram.id[1] != 'S' || sc->sc_nvram.id[2] != 'P' || sc->sc_nvram.id[3] != ' ' || diff --git a/sys/dev/ic/wdcevent.h b/sys/dev/ic/wdcevent.h index 90380c19f52..9e05c51d25b 100644 --- a/sys/dev/ic/wdcevent.h +++ b/sys/dev/ic/wdcevent.h @@ -1,4 +1,4 @@ -/* $OpenBSD: wdcevent.h,v 1.6 2008/07/02 03:00:55 fgsch Exp $ */ +/* $OpenBSD: wdcevent.h,v 1.7 2014/12/19 07:23:57 deraadt Exp $ */ /* * Copyright (c) 2001 Constantine Sapuntzakis * @@ -67,7 +67,7 @@ static __inline void WDC_LOG_ATAPI_CMD(struct channel_softc *chp, int drive, record[0] = (flags >> 8); record[1] = flags & 0xff; - bcopy(cmd, &record[2], len); + memcpy(&record[2], cmd, len); wdc_log(chp, WDCEVENT_ATAPI_CMD, len + 2, record); } diff --git a/sys/dev/ic/xl.c b/sys/dev/ic/xl.c index be53e83771c..e45764b7a2d 100644 --- a/sys/dev/ic/xl.c +++ b/sys/dev/ic/xl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xl.c,v 1.119 2014/12/08 10:58:45 brad Exp $ */ +/* $OpenBSD: xl.c,v 1.120 2014/12/19 07:23:57 deraadt Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -678,10 +678,10 @@ xl_testpacket(struct xl_softc *sc) if (m == NULL) return; - bcopy(&sc->sc_arpcom.ac_enaddr, - mtod(m, struct ether_header *)->ether_dhost, ETHER_ADDR_LEN); - bcopy(&sc->sc_arpcom.ac_enaddr, - mtod(m, struct ether_header *)->ether_shost, ETHER_ADDR_LEN); + memcpy(mtod(m, struct ether_header *)->ether_dhost, + &sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); + memcpy(mtod(m, struct ether_header *)->ether_shost, + &sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); mtod(m, struct ether_header *)->ether_type = htons(3); mtod(m, unsigned char *)[14] = 0; mtod(m, unsigned char *)[15] = 0; @@ -2408,7 +2408,7 @@ xl_attach(struct xl_softc *sc) sc->sc_dev.dv_xname); return; } - bcopy(enaddr, &sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN); + memcpy(&sc->sc_arpcom.ac_enaddr, 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, @@ -2513,7 +2513,7 @@ xl_attach(struct xl_softc *sc) ifp->if_baudrate = 10000000; IFQ_SET_MAXLEN(&ifp->if_snd, XL_TX_LIST_CNT - 1); IFQ_SET_READY(&ifp->if_snd); - bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ); + memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ); ifp->if_capabilities = IFCAP_VLAN_MTU;