From 9e4f07dc391604e21b01c1df96319508ee425d6d Mon Sep 17 00:00:00 2001 From: tedu Date: Mon, 15 Dec 2014 02:11:57 +0000 Subject: [PATCH] convert bcopy to memcpy. ok dlg krw --- sys/scsi/cd.c | 18 +++++++++--------- sys/scsi/scsi_ioctl.c | 6 +++--- sys/scsi/scsiconf.c | 4 ++-- sys/scsi/sd.c | 8 ++++---- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index a1d4cd393ce..076ace8ea18 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.215 2014/09/14 14:17:26 jsg Exp $ */ +/* $OpenBSD: cd.c,v 1.216 2014/12/15 02:11:57 tedu Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -790,8 +790,8 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) case DIOCRLDINFO: lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); cdgetdisklabel(dev, sc, lp, 0); - bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP, 0); + memcpy(sc->sc_dk.dk_label, lp, sizeof(*lp)); + free(lp, M_TEMP, sizeof(*lp)); break; case DIOCGPDINFO: @@ -889,7 +889,7 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) else th->len = betoh16(th->len); if (th->len > 0) - bcopy(th, addr, sizeof(*th)); + memcpy(addr, th, sizeof(*th)); else error = EIO; dma_free(th, sizeof(*th)); @@ -1644,8 +1644,8 @@ cddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size) return ENXIO; } -#define dvd_copy_key(dst, src) bcopy((src), (dst), DVD_KEY_SIZE) -#define dvd_copy_challenge(dst, src) bcopy((src), (dst), DVD_CHALLENGE_SIZE) +#define dvd_copy_key(dst, src) memcpy((dst), (src), DVD_KEY_SIZE) +#define dvd_copy_challenge(dst, src) memcpy((dst), (src), DVD_CHALLENGE_SIZE) #define DVD_AUTH_BUFSIZE 20 @@ -1964,7 +1964,7 @@ dvd_read_disckey(struct cd_softc *sc, union dvd_struct *s) scsi_xs_put(xs); if (error == 0) - bcopy(buf->data, s->disckey.value, sizeof(s->disckey.value)); + memcpy(s->disckey.value, buf->data, sizeof(s->disckey.value)); done: dma_free(buf, sizeof(*buf)); return (error); @@ -2006,7 +2006,7 @@ dvd_read_bca(struct cd_softc *sc, union dvd_struct *s) s->bca.len = _2btol(&buf[0]); if (s->bca.len < 12 || s->bca.len > 188) return (EIO); - bcopy(&buf[4], s->bca.value, s->bca.len); + memcpy(s->bca.value, &buf[4], s->bca.len); } done: dma_free(buf, DVD_READ_BCA_BUFLEN); @@ -2046,7 +2046,7 @@ dvd_read_manufact(struct cd_softc *sc, union dvd_struct *s) if (error == 0) { s->manufact.len = _2btol(buf->len); if (s->manufact.len >= 0 && s->manufact.len <= 2048) - bcopy(buf->data, s->manufact.value, s->manufact.len); + memcpy(s->manufact.value, buf->data, s->manufact.len); else error = EIO; } diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index fbd56a467a7..44fbba69502 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_ioctl.c,v 1.48 2011/06/21 22:36:42 matthew Exp $ */ +/* $OpenBSD: scsi_ioctl.c,v 1.49 2014/12/15 02:11:57 tedu Exp $ */ /* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */ /* @@ -156,7 +156,7 @@ scsi_ioc_cmd(struct scsi_link *link, scsireq_t *screq) #endif screq->senselen_used = min(sizeof(xs->sense), sizeof(screq->sense)); - bcopy(&xs->sense, screq->sense, screq->senselen_used); + memcpy(screq->sense, &xs->sense, screq->senselen_used); screq->retsts = SCCMD_SENSE; break; case XS_SHORTSENSE: @@ -166,7 +166,7 @@ scsi_ioc_cmd(struct scsi_link *link, scsireq_t *screq) printf("XS_SHORTSENSE\n"); screq->senselen_used = min(sizeof(xs->sense), sizeof(screq->sense)); - bcopy(&xs->sense, screq->sense, screq->senselen_used); + memcpy(screq->sense, &xs->sense, screq->senselen_used); screq->retsts = SCCMD_UNKNOWN; break; case XS_DRIVER_STUFFUP: diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 0702b3d0674..a622d2737d6 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.188 2014/07/12 18:50:25 tedu Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.189 2014/12/15 02:11:57 tedu Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -932,7 +932,7 @@ scsi_probedev(struct scsibus_softc *scsi, int target, int lun) } rslt = scsi_inquire(sc_link, inqbuf, scsi_autoconf | SCSI_SILENT); - bcopy(inqbuf, &sc_link->inqdata, sizeof(sc_link->inqdata)); + memcpy(&sc_link->inqdata, inqbuf, sizeof(sc_link->inqdata)); dma_free(inqbuf, sizeof(*inqbuf)); if (rslt != 0) { diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 68053ec2d26..caf0d873b0e 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.257 2014/09/18 18:47:29 kettenis Exp $ */ +/* $OpenBSD: sd.c,v 1.258 2014/12/15 02:11:57 tedu Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -862,8 +862,8 @@ sdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) case DIOCRLDINFO: lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); sdgetdisklabel(dev, sc, lp, 0); - bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp)); - free(lp, M_TEMP, 0); + memcpy(sc->sc_dk.dk_label, lp, sizeof(*lp)); + free(lp, M_TEMP, sizeof(*lp)); goto exit; case DIOCGPDINFO: @@ -1095,7 +1095,7 @@ sdgetdisklabel(dev_t dev, struct sd_softc *sc, struct disklabel *lp, * always null terminated and len does not count the terminating null. * d_packname is not a null terminated string. */ - bcopy(packname, lp->d_packname, len); + memcpy(lp->d_packname, packname, len); DL_SETDSIZE(lp, sc->params.disksize); lp->d_version = 1; -- 2.20.1