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 | |
parent | 4e938475ab0036021afd3865e42fa687ae5f596b (diff) |
Convert sparc drivers bpp and magma to uiomove
Compile test and ok tobiasu@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/dev/bpp.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/dev/magma.c | 12 | ||||
-rw-r--r-- | sys/dev/sbus/bpp.c | 8 | ||||
-rw-r--r-- | sys/dev/sbus/magma.c | 12 |
4 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/sparc/dev/bpp.c b/sys/arch/sparc/dev/bpp.c index f4648d1d721..ec5b7454c1a 100644 --- a/sys/arch/sparc/dev/bpp.c +++ b/sys/arch/sparc/dev/bpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpp.c,v 1.6 2015/02/10 21:56:09 miod Exp $ */ +/* $OpenBSD: bpp.c,v 1.7 2016/03/14 18:01:18 stefan Exp $ */ /* * Copyright (c) 1997, Jason Downs. All rights reserved. @@ -272,8 +272,8 @@ bppwrite(dev, uio, flags) size_t n; int error = 0; - while ((n = min(BPP_BSIZE, uio->uio_resid)) != 0) { - error = uiomovei(bpp->sc_cp = bpp->sc_inbuf->b_data, n, uio); + while ((n = ulmin(BPP_BSIZE, uio->uio_resid)) != 0) { + error = uiomove(bpp->sc_cp = bpp->sc_inbuf->b_data, n, uio); if (error != 0) return error; bpp->sc_count = n; diff --git a/sys/arch/sparc/dev/magma.c b/sys/arch/sparc/dev/magma.c index d512402fd7b..bd98e4cb956 100644 --- a/sys/arch/sparc/dev/magma.c +++ b/sys/arch/sparc/dev/magma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: magma.c,v 1.29 2015/02/10 21:56:09 miod Exp $ */ +/* $OpenBSD: magma.c,v 1.30 2016/03/14 18:01:18 stefan Exp $ */ /*- * Copyright (c) 1998 Iain Hibbert @@ -1649,14 +1649,14 @@ mbpp_rw(dev, uio) struct mbpp_softc *ms = mbpp_cd.cd_devs[card]; register 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); @@ -1671,11 +1671,11 @@ mbpp_rw(dev, 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; } @@ -1695,7 +1695,7 @@ again: /* goto bad */ if (uio->uio_rw == UIO_READ) { if (cnt) { - error = uiomovei(ptr, cnt, uio); + error = uiomove(ptr, cnt, uio); if (error) break; gotdata++; 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++; |