diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-10 21:56:11 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2015-02-10 21:56:11 +0000 |
commit | fb06ed88b5810f53d16a2f3f90904ed7ea4de07a (patch) | |
tree | 0ad268ca945306e22e87692f6bb02fcd1220d0e4 /sys/dev/usb | |
parent | 4ed4205fc6bdb404dcf67f9f19347eea957f5982 (diff) |
First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/ugen.c | 18 | ||||
-rw-r--r-- | sys/dev/usb/uhid.c | 8 | ||||
-rw-r--r-- | sys/dev/usb/ulpt.c | 4 | ||||
-rw-r--r-- | sys/dev/usb/usb.c | 8 |
4 files changed, 19 insertions, 19 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 29a9b22c242..afb0b62eb8e 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.80 2015/01/11 03:07:44 deraadt Exp $ */ +/* $OpenBSD: ugen.c,v 1.81 2015/02/10 21:56:09 miod Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -527,7 +527,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) DPRINTFN(5, ("ugenread: got %d chars\n", n)); /* Copy the data to the user process. */ - error = uiomove(buffer, n, uio); + error = uiomovei(buffer, n, uio); if (error) break; } @@ -558,7 +558,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) } usbd_get_xfer_status(xfer, NULL, NULL, &tn, NULL); DPRINTFN(1, ("ugenread: got %d bytes\n", tn)); - error = uiomove(buf, tn, uio); + error = uiomovei(buf, tn, uio); if (error || tn < n) break; } @@ -596,7 +596,7 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) DPRINTFN(5, ("ugenread: isoc got %d chars\n", n)); /* Copy the data to the user process. */ - error = uiomove(sce->cur, n, uio); + error = uiomovei(sce->cur, n, uio); if (error) break; sce->cur += n; @@ -667,7 +667,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) if (xfer == 0) return (EIO); while ((n = min(UGEN_BBSIZE, uio->uio_resid)) != 0) { - error = uiomove(buf, n, uio); + error = uiomovei(buf, n, uio); if (error) break; DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n)); @@ -693,7 +693,7 @@ ugen_do_write(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) return (EIO); while ((n = min(UGETW(sce->edesc->wMaxPacketSize), uio->uio_resid)) != 0) { - error = uiomove(buf, n, uio); + error = uiomovei(buf, n, uio); if (error) break; DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n)); @@ -1127,7 +1127,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, uio.uio_segflg = UIO_USERSPACE; uio.uio_rw = UIO_READ; uio.uio_procp = p; - error = uiomove((void *)cdesc, len, &uio); + error = uiomovei((void *)cdesc, len, &uio); free(cdesc, M_TEMP, 0); return (error); } @@ -1177,7 +1177,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, uio.uio_procp = p; ptr = malloc(len, M_TEMP, M_WAITOK); if (uio.uio_rw == UIO_WRITE) { - error = uiomove(ptr, len, &uio); + error = uiomovei(ptr, len, &uio); if (error) goto ret; } @@ -1194,7 +1194,7 @@ ugen_do_ioctl(struct ugen_softc *sc, int endpt, u_long cmd, len = ur->ucr_actlen; if (len != 0) { if (uio.uio_rw == UIO_READ) { - error = uiomove(ptr, len, &uio); + error = uiomovei(ptr, len, &uio); if (error) goto ret; } diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index d0f53a50425..c24b9e5aac3 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.59 2014/12/11 18:39:27 mpi Exp $ */ +/* $OpenBSD: uhid.c,v 1.60 2015/02/10 21:56:09 miod Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -269,7 +269,7 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag) UHID_INPUT_REPORT, sc->sc_hdev.sc_report_id, buffer, sc->sc_hdev.sc_isize) != sc->sc_hdev.sc_isize) return (EIO); - return (uiomove(buffer, sc->sc_hdev.sc_isize, uio)); + return (uiomovei(buffer, sc->sc_hdev.sc_isize, uio)); } s = splusb(); @@ -302,7 +302,7 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag) DPRINTFN(5, ("uhidread: got %lu chars\n", (u_long)length)); /* Copy the data to the user process. */ - if ((error = uiomove(buffer, length, uio)) != 0) + if ((error = uiomovei(buffer, length, uio)) != 0) break; } @@ -339,7 +339,7 @@ uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag) error = 0; if (uio->uio_resid != size) return (EINVAL); - error = uiomove(sc->sc_obuf, size, uio); + error = uiomovei(sc->sc_obuf, size, uio); if (!error) { if (uhidev_set_report(sc->sc_hdev.sc_parent, UHID_OUTPUT_REPORT, sc->sc_hdev.sc_report_id, sc->sc_obuf, diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c index adbf23d2453..2d313749459 100644 --- a/sys/dev/usb/ulpt.c +++ b/sys/dev/usb/ulpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ulpt.c,v 1.48 2014/10/19 16:35:53 stsp Exp $ */ +/* $OpenBSD: ulpt.c,v 1.49 2015/02/10 21:56:09 miod Exp $ */ /* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */ /* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */ @@ -624,7 +624,7 @@ ulpt_do_write(struct ulpt_softc *sc, struct uio *uio, int flags) } while ((n = min(ULPT_BSIZE, uio->uio_resid)) != 0) { ulpt_statusmsg(ulpt_status(sc), sc); - error = uiomove(bufp, n, uio); + error = uiomovei(bufp, n, uio); if (error) break; DPRINTFN(1, ("ulptwrite: transfer %d bytes\n", n)); diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 5dcf89099eb..fc175c0c84b 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.105 2015/02/09 12:45:12 uebayasi Exp $ */ +/* $OpenBSD: usb.c,v 1.106 2015/02/10 21:56:09 miod Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -643,7 +643,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p) uio.uio_procp = p; ptr = malloc(len, M_TEMP, M_WAITOK); if (uio.uio_rw == UIO_WRITE) { - error = uiomove(ptr, len, &uio); + error = uiomovei(ptr, len, &uio); if (error) goto ret; } @@ -660,7 +660,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p) len = ur->ucr_actlen; if (len != 0) { if (uio.uio_rw == UIO_READ) { - error = uiomove(ptr, len, &uio); + error = uiomovei(ptr, len, &uio); if (error) goto ret; } @@ -788,7 +788,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, struct proc *p) uio.uio_segflg = UIO_USERSPACE; uio.uio_rw = UIO_READ; uio.uio_procp = p; - error = uiomove((void *)cdesc, len, &uio); + error = uiomovei((void *)cdesc, len, &uio); free(cdesc, M_TEMP, 0); return (error); } |