Use MIN(a,b) from <sys/param.h> instead of rolling our own version.

Pointed out by:	grehan
This commit is contained in:
Neel Natu 2014-06-01 02:47:09 +00:00
parent 0be3798af5
commit 26cdcdbebb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266935
2 changed files with 2 additions and 10 deletions

View File

@ -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,

View File

@ -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: