summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-06-01 02:47:09 +0000
committerneel <neel@FreeBSD.org>2014-06-01 02:47:09 +0000
commita09b56e60a56810243d59c053381e421befbcf2e (patch)
tree36b5eb1e5e4e3f2bba86a40fbb49a5342d8f7943 /usr.sbin
parenta6503bd2d624edd4017ade0d1edb3ad7ce366549 (diff)
downloadFreeBSD-src-a09b56e60a56810243d59c053381e421befbcf2e.zip
FreeBSD-src-a09b56e60a56810243d59c053381e421befbcf2e.tar.gz
Use MIN(a,b) from <sys/param.h> instead of rolling our own version.
Pointed out by: grehan
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/inout.c6
-rw-r--r--usr.sbin/bhyve/pci_virtio_block.c6
2 files changed, 2 insertions, 10 deletions
diff --git a/usr.sbin/bhyve/inout.c b/usr.sbin/bhyve/inout.c
index cb34b80..fe9e0d8 100644
--- a/usr.sbin/bhyve/inout.c
+++ b/usr.sbin/bhyve/inout.c
@@ -55,10 +55,6 @@ SET_DECLARE(inout_port_set, struct inout_port);
#define VERIFY_IOPORT(port, size) \
assert((port) >= 0 && (size) > 0 && ((port) + (size)) <= MAX_IOPORTS)
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
static struct {
const char *name;
int flags;
@@ -156,7 +152,7 @@ emulate_inout(struct vmctx *ctx, int vcpu, struct vm_exit *vmexit, int strict)
count = vis->count & vie_size2mask(addrsize);
/* Limit number of back-to-back in/out emulations to 16 */
- iterations = min(count, 16);
+ iterations = MIN(count, 16);
while (iterations > 0) {
if (vie_calculate_gla(vis->paging.cpu_mode,
vis->seg_name, &vis->seg_desc, index, bytes,
diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c
index 3474fd7..cf1c655 100644
--- a/usr.sbin/bhyve/pci_virtio_block.c
+++ b/usr.sbin/bhyve/pci_virtio_block.c
@@ -52,10 +52,6 @@ __FBSDID("$FreeBSD$");
#include "pci_emul.h"
#include "virtio.h"
-#ifndef min
-#define min(a, b) ((a) < (b) ? (a) : (b))
-#endif
-
#define VTBLK_RINGSZ 64
#define VTBLK_MAXSEGS 32
@@ -217,7 +213,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vqueue_info *vq)
case VBH_OP_IDENT:
/* Assume a single buffer */
strlcpy(iov[1].iov_base, sc->vbsc_ident,
- min(iov[1].iov_len, sizeof(sc->vbsc_ident)));
+ MIN(iov[1].iov_len, sizeof(sc->vbsc_ident)));
err = 0;
break;
default:
OpenPOWER on IntegriCloud