summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2014-01-23 00:19:10 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2014-01-23 00:19:10 +0000
commit8b5467b087035a3ca8878930c86473af64d19a4d (patch)
tree12e79abb73d3f5ba1a6a5c11d2e5904097338441 /sys/arch
parente2a098bb90019fde2d7b17d149ee75a46580a0bb (diff)
Use MIN() instead of min() as we're dealing with 64-bit types.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/dev/vdsp.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/arch/sparc64/dev/vdsp.c b/sys/arch/sparc64/dev/vdsp.c
index 4bb8201bd18..bdc89b76622 100644
--- a/sys/arch/sparc64/dev/vdsp.c
+++ b/sys/arch/sparc64/dev/vdsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vdsp.c,v 1.19 2013/07/12 18:51:03 kettenis Exp $ */
+/* $OpenBSD: vdsp.c,v 1.20 2014/01/23 00:19:09 kettenis Exp $ */
/*
* Copyright (c) 2009, 2011 Mark Kettenis
*
@@ -717,7 +717,7 @@ vdsp_rx_vio_dring_data(struct vdsp_softc *sc, struct vio_msg_tag *tag)
size = sc->sc_descriptor_size;
while (size > 0) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(sc->sc_lc.lc_id, LDC_COPY_IN,
sc->sc_dring_cookie.addr + off, pa,
nbytes, &nbytes);
@@ -1089,8 +1089,8 @@ vdsp_read(void *arg1, void *arg2)
off = 0;
while (size > 0 && i < dm->ncookies) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, dm->cookie[i].size - off);
- nbytes = min(nbytes, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, dm->cookie[i].size - off);
+ nbytes = MIN(nbytes, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(lc->lc_id, LDC_COPY_OUT,
dm->cookie[i].addr + off, pa, nbytes, &nbytes);
if (err != H_EOK)
@@ -1156,8 +1156,8 @@ vdsp_read_dring(void *arg1, void *arg2)
off = 0;
while (size > 0 && i < vd->ncookies) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, vd->cookie[i].size - off);
- nbytes = min(nbytes, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, vd->cookie[i].size - off);
+ nbytes = MIN(nbytes, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(lc->lc_id, LDC_COPY_OUT,
vd->cookie[i].addr + off, pa, nbytes, &nbytes);
if (err != H_EOK)
@@ -1206,8 +1206,8 @@ vdsp_write_dring(void *arg1, void *arg2)
off = 0;
while (size > 0 && i < vd->ncookies) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, vd->cookie[i].size - off);
- nbytes = min(nbytes, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, vd->cookie[i].size - off);
+ nbytes = MIN(nbytes, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(lc->lc_id, LDC_COPY_IN,
vd->cookie[i].addr + off, pa, nbytes, &nbytes);
if (err != H_EOK)
@@ -1327,8 +1327,8 @@ vdsp_get_vtoc(void *arg1, void *arg2)
off = 0;
while (size > 0 && i < vd->ncookies) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, vd->cookie[i].size - off);
- nbytes = min(nbytes, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, vd->cookie[i].size - off);
+ nbytes = MIN(nbytes, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(lc->lc_id, LDC_COPY_OUT,
vd->cookie[i].addr + off, pa, nbytes, &nbytes);
if (err != H_EOK)
@@ -1373,8 +1373,8 @@ vdsp_set_vtoc(void *arg1, void *arg2)
off = 0;
while (size > 0 && i < vd->ncookies) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, vd->cookie[i].size - off);
- nbytes = min(nbytes, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, vd->cookie[i].size - off);
+ nbytes = MIN(nbytes, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(lc->lc_id, LDC_COPY_IN,
vd->cookie[i].addr + off, pa, nbytes, &nbytes);
if (err != H_EOK)
@@ -1504,8 +1504,8 @@ vdsp_get_diskgeom(void *arg1, void *arg2)
off = 0;
while (size > 0 && i < vd->ncookies) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, vd->cookie[i].size - off);
- nbytes = min(nbytes, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, vd->cookie[i].size - off);
+ nbytes = MIN(nbytes, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(lc->lc_id, LDC_COPY_OUT,
vd->cookie[i].addr + off, pa, nbytes, &nbytes);
if (err != H_EOK)
@@ -1552,7 +1552,7 @@ vdsp_ack_desc(struct vdsp_softc *sc, struct vd_desc *vd)
size = sc->sc_descriptor_size;
while (size > 0) {
pmap_extract(pmap_kernel(), va, &pa);
- nbytes = min(size, PAGE_SIZE - (off & PAGE_MASK));
+ nbytes = MIN(size, PAGE_SIZE - (off & PAGE_MASK));
err = hv_ldc_copy(sc->sc_lc.lc_id, LDC_COPY_OUT,
sc->sc_dring_cookie.addr + off, pa, nbytes, &nbytes);
if (err != H_EOK) {