From owner-svn-src-head@FreeBSD.ORG Sun Jun 1 02:47:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C68494; Sun, 1 Jun 2014 02:47:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4943F24B2; Sun, 1 Jun 2014 02:47:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s512lAuP077974; Sun, 1 Jun 2014 02:47:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s512l9wN077972; Sun, 1 Jun 2014 02:47:09 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201406010247.s512l9wN077972@svn.freebsd.org> From: Neel Natu Date: Sun, 1 Jun 2014 02:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266935 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 02:47:10 -0000 Author: neel Date: Sun Jun 1 02:47:09 2014 New Revision: 266935 URL: http://svnweb.freebsd.org/changeset/base/266935 Log: Use MIN(a,b) from instead of rolling our own version. Pointed out by: grehan Modified: head/usr.sbin/bhyve/inout.c head/usr.sbin/bhyve/pci_virtio_block.c Modified: head/usr.sbin/bhyve/inout.c ============================================================================== --- head/usr.sbin/bhyve/inout.c Sun Jun 1 02:13:07 2014 (r266934) +++ head/usr.sbin/bhyve/inout.c Sun Jun 1 02:47:09 2014 (r266935) @@ -55,10 +55,6 @@ SET_DECLARE(inout_port_set, struct inout #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 vcp 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, Modified: head/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_block.c Sun Jun 1 02:13:07 2014 (r266934) +++ head/usr.sbin/bhyve/pci_virtio_block.c Sun Jun 1 02:47:09 2014 (r266935) @@ -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 *s 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: