diff --git a/sys/alpha/alpha/busdma_machdep.c b/sys/alpha/alpha/busdma_machdep.c index 3fcbc30ac1fc..28240ae0c27d 100644 --- a/sys/alpha/alpha/busdma_machdep.c +++ b/sys/alpha/alpha/busdma_machdep.c @@ -45,8 +45,6 @@ #include #include -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX_BPAGES 128 struct bus_dma_tag { diff --git a/sys/amd64/amd64/busdma_machdep.c b/sys/amd64/amd64/busdma_machdep.c index c55469faad2f..21e602544130 100644 --- a/sys/amd64/amd64/busdma_machdep.c +++ b/sys/amd64/amd64/busdma_machdep.c @@ -44,8 +44,6 @@ #include #include -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX_BPAGES 128 struct bus_dma_tag { diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index a187c796a18f..ebfe241a35f5 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -172,10 +172,6 @@ static struct cd_quirk_entry cd_quirk_table[] = } }; -#ifndef MIN -#define MIN(x,y) ((x b) ? b : a) - /* Offsets into our private CCB area for storing accept information */ #define ccb_type ppriv_field0 #define ccb_descr ppriv_ptr1 diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c index 674200948939..ce2b68af34b2 100644 --- a/sys/compat/svr4/svr4_stream.c +++ b/sys/compat/svr4/svr4_stream.c @@ -329,9 +329,6 @@ svr4_recvit(td, s, mp, namelenp) if (len <= 0 || fromsa == 0) len = 0; else { -#ifndef MIN -#define MIN(a,b) ((a)>(b)?(b):(a)) -#endif /* save sa_len before it is destroyed by MSG_COMPAT */ len = MIN(len, fromsa->sa_len); error = copyout(fromsa, diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c index ea4dcc3aabe5..453fe75d12e1 100644 --- a/sys/contrib/dev/oltr/if_oltr.c +++ b/sys/contrib/dev/oltr/if_oltr.c @@ -92,7 +92,6 @@ #define PCI_VENDOR_OLICOM 0x108D -#define MIN(A,B) (((A) < (B)) ? (A) : (B)) #define MIN3(A,B,C) (MIN(A, (MIN(B, C)))) char *AdapterName[] = { diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 332835d40e9f..d612adf32115 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -84,10 +84,6 @@ static const char rcsid[] = "@(#)$FreeBSD$"; extern KRWLOCK_T ipf_nat, ipf_state; #endif -#ifndef MIN -#define MIN(a,b) (((a)<(b))?(a):(b)) -#endif - static int appr_fixseqack __P((fr_info_t *, ip_t *, ap_session_t *, int )); diff --git a/sys/dev/advansys/advlib.c b/sys/dev/advansys/advlib.c index 7d3ec52f56d6..d8a35abfe3f9 100644 --- a/sys/dev/advansys/advlib.c +++ b/sys/dev/advansys/advlib.c @@ -1170,8 +1170,6 @@ adv_period_offset_to_sdtr(struct adv_softc *adv, u_int *period, period = &dummy_period; } -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) - *offset = MIN(ADV_SYN_MAX_OFFSET, *offset); if (*period != 0 && *offset != 0) { for (i = 0; i < adv->sdtr_period_tbl_size; i++) { diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c index 91d2c7d44639..50074131d359 100644 --- a/sys/dev/advansys/adwcam.c +++ b/sys/dev/advansys/adwcam.c @@ -72,8 +72,6 @@ #define ccb_acb_ptr spriv_ptr0 #define ccb_adw_ptr spriv_ptr1 -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - u_long adw_unit; static __inline cam_status adwccbstatus(union ccb*); diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c index b4dc58b7ab41..4ba7cea2b183 100644 --- a/sys/dev/aha/aha.c +++ b/sys/dev/aha/aha.c @@ -84,10 +84,6 @@ */ #define PROBABLY_NEW_BOARD(REV) (REV > 0x43 && REV < 0x56) -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /* MailBox Management functions */ static __inline void ahanextinbox(struct aha_softc *aha); static __inline void ahanextoutbox(struct aha_softc *aha); diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c index 740d626036c1..ec5d1381fc65 100644 --- a/sys/dev/ahb/ahb.c +++ b/sys/dev/ahb/ahb.c @@ -55,8 +55,6 @@ #define ccb_ecb_ptr spriv_ptr0 #define ccb_ahb_ptr spriv_ptr1 -#define MIN(a, b) ((a) < (b) ? (a) : (b)) - #define ahb_inb(ahb, port) \ bus_space_read_1((ahb)->tag, (ahb)->bsh, port) diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c index 7bb301074556..b7bc725bbb5d 100644 --- a/sys/dev/buslogic/bt.c +++ b/sys/dev/buslogic/bt.c @@ -72,10 +72,6 @@ #include -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif - /* MailBox Management functions */ static __inline void btnextinbox(struct bt_softc *bt); static __inline void btnextoutbox(struct bt_softc *bt); diff --git a/sys/dev/sound/pci/cs4281.c b/sys/dev/sound/pci/cs4281.c index e34a1621a8ed..6018ec2603de 100644 --- a/sys/dev/sound/pci/cs4281.c +++ b/sys/dev/sound/pci/cs4281.c @@ -50,9 +50,6 @@ SND_DECLARE_FILE("$FreeBSD$"); /* Misc */ -#define MIN(x,y) (x) < (y) ? (x) : (y) -#define MAX(x,y) (x) > (y) ? (x) : (y) - #define inline __inline #ifndef DEB diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c index 689ce89d696d..fc52a6b87c97 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -397,13 +397,6 @@ static __inline struct sym_quehead *sym_remque_tail(struct sym_quehead *head) */ #define MAX_QUEUE SYM_CONF_MAX_QUEUE -/* - * These ones should have been already defined. - */ -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - /* * Active debugging tags and verbosity. */ diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index c55469faad2f..21e602544130 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -44,8 +44,6 @@ #include #include -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX_BPAGES 128 struct bus_dma_tag { diff --git a/sys/i386/isa/gpib.c b/sys/i386/isa/gpib.c index 184c5069144c..4b7b3cbb5f2f 100644 --- a/sys/i386/isa/gpib.c +++ b/sys/i386/isa/gpib.c @@ -35,8 +35,6 @@ #error "The gpib device requires the old isa compatibility shims" #endif -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - #define GPIBPRI (PZERO + 8) | PCATCH #define SLEEP_MAX 1000 #define SLEEP_MIN 4 diff --git a/sys/i386/isa/gsc.c b/sys/i386/isa/gsc.c index f8328cf5c205..5a9483844e5a 100644 --- a/sys/i386/isa/gsc.c +++ b/sys/i386/isa/gsc.c @@ -80,8 +80,6 @@ #define lprintf(args) #endif -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) - #define TIMEOUT (hz*15) /* timeout while reading a buffer - default value */ #define LONG (hz/60) /* timesteps while reading a buffer */ #define GSCPRI PRIBIO /* priority while reading a buffer */ diff --git a/sys/ia64/ia64/busdma_machdep.c b/sys/ia64/ia64/busdma_machdep.c index 4bf52d53e1b7..e10f0843d855 100644 --- a/sys/ia64/ia64/busdma_machdep.c +++ b/sys/ia64/ia64/busdma_machdep.c @@ -42,8 +42,6 @@ #include #include -#define MAX(a,b) (((a) > (b)) ? (a) : (b)) -#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MAX_BPAGES 128 struct bus_dma_tag { diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 8fd69e7ff49d..145e138a7806 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -947,9 +947,6 @@ recvit(td, s, mp, namelenp) if (len <= 0 || fromsa == 0) len = 0; else { -#ifndef MIN -#define MIN(a,b) ((a)>(b)?(b):(a)) -#endif /* save sa_len before it is destroyed by MSG_COMPAT */ len = MIN(len, fromsa->sa_len); #ifdef COMPAT_OLDSOCK diff --git a/sys/net/zlib.c b/sys/net/zlib.c index 87974051fd61..9052c1fd6348 100644 --- a/sys/net/zlib.c +++ b/sys/net/zlib.c @@ -2055,8 +2055,6 @@ local void send_bits(s, value, length) } #endif /* DEBUG_ZLIB */ - -#define MAX(a,b) (a >= b ? a : b) /* the arguments must not have side effects */ /* =========================================================================== diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index df3fdb9d3f55..3e1fccf82590 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -204,7 +204,6 @@ void nd6_setmtu(ifp) struct ifnet *ifp; { -#define MIN(a,b) ((a) < (b) ? (a) : (b)) struct nd_ifinfo *ndi = &nd_ifinfo[ifp->if_index]; u_long oldmaxmtu = ndi->maxmtu; u_long oldlinkmtu = ndi->linkmtu; diff --git a/sys/pccard/pccard.c b/sys/pccard/pccard.c index bf426fb1d146..17e8e9bd5b47 100644 --- a/sys/pccard/pccard.c +++ b/sys/pccard/pccard.c @@ -52,8 +52,6 @@ #include -#define MIN(a,b) ((a)<(b)?(a):(b)) - static int allocate_driver(struct slot *, struct dev_desc *); static void inserted(void *); static void disable_slot(struct slot *); diff --git a/sys/sys/param.h b/sys/sys/param.h index 9b37d1974e79..036e4bbeeef1 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -252,10 +252,8 @@ #define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ -#ifndef _KERNEL #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) -#endif #ifdef _KERNEL /*