diff options
author | Stefan Kempf <stefan@cvs.openbsd.org> | 2016-03-14 18:01:19 +0000 |
---|---|---|
committer | Stefan Kempf <stefan@cvs.openbsd.org> | 2016-03-14 18:01:19 +0000 |
commit | 3176c2567eb1c770f0c6c493ff8833b7a05b5695 (patch) | |
tree | 45ac50e8b87423f3545f5ebf0b0788279647fc8a /sys/dev/sbus | |
parent | 4e938475ab0036021afd3865e42fa687ae5f596b (diff) |
Convert sparc drivers bpp and magma to uiomove
Compile test and ok tobiasu@
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r-- | sys/dev/sbus/bpp.c | 8 | ||||
-rw-r--r-- | sys/dev/sbus/magma.c | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/sbus/bpp.c b/sys/dev/sbus/bpp.c index f03f25ca8ba..c9f22e2cf12 100644 --- a/sys/dev/sbus/bpp.c +++ b/sys/dev/sbus/bpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpp.c,v 1.4 2015/02/10 21:56:09 miod Exp $ */ +/* $OpenBSD: bpp.c,v 1.5 2016/03/14 18:01:18 stefan Exp $ */ /* $NetBSD: bpp.c,v 1.25 2005/12/11 12:23:44 christos Exp $ */ /*- @@ -303,9 +303,9 @@ bppwrite(dev_t dev, struct uio *uio, int flags) */ while (uio->uio_resid > 0) { caddr_t bp = sc->sc_buf; - size_t len = min(sc->sc_bufsz, uio->uio_resid); + size_t len = ulmin(sc->sc_bufsz, uio->uio_resid); - if ((error = uiomovei(bp, len, uio)) != 0) + if ((error = uiomove(bp, len, uio)) != 0) break; while (len > 0) { @@ -315,7 +315,7 @@ bppwrite(dev_t dev, struct uio *uio, int flags) #ifdef DEBUG if (bppdebug) { - int i; + size_t i; printf("bpp: writing %ld : ", len); for (i=0; i<len; i++) printf("%c(0x%x)", bp[i], bp[i]); printf("\n"); diff --git a/sys/dev/sbus/magma.c b/sys/dev/sbus/magma.c index 502d433f2aa..ff8ac99e596 100644 --- a/sys/dev/sbus/magma.c +++ b/sys/dev/sbus/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.25 2015/02/10 21:56:09 miod Exp $ */ +/* $OpenBSD: magma.c,v 1.26 2016/03/14 18:01:18 stefan Exp $ */ /*- * Copyright (c) 1998 Iain Hibbert @@ -1523,14 +1523,14 @@ mbpp_rw(dev_t dev, struct uio *uio) struct mbpp_softc *ms = mbpp_cd.cd_devs[card]; struct mbpp_port *mp = &ms->ms_port[port]; caddr_t buffer, ptr; - int buflen, cnt, len; + size_t buflen, cnt, len; int s, error = 0; int gotdata = 0; if (uio->uio_resid == 0) return (0); - buflen = min(uio->uio_resid, mp->mp_burst); + buflen = ulmin(uio->uio_resid, mp->mp_burst); buffer = malloc(buflen, M_DEVBUF, M_WAITOK); SET(mp->mp_flags, MBPPF_UIO); @@ -1545,11 +1545,11 @@ mbpp_rw(dev_t dev, struct uio *uio) len = cnt = 0; while (uio->uio_resid > 0) { - len = min(buflen, uio->uio_resid); + len = ulmin(buflen, uio->uio_resid); ptr = buffer; if (uio->uio_rw == UIO_WRITE) { - error = uiomovei(ptr, len, uio); + error = uiomove(ptr, len, uio); if (error) break; } @@ -1569,7 +1569,7 @@ mbpp_rw(dev_t dev, struct uio *uio) if (uio->uio_rw == UIO_READ) { if (cnt) { - error = uiomovei(ptr, cnt, uio); + error = uiomove(ptr, cnt, uio); if (error) break; gotdata++; |