diff options
author | alfred <alfred@FreeBSD.org> | 2003-02-02 13:17:30 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2003-02-02 13:17:30 +0000 |
commit | b5c0015ac9dfb47f49151ad199edb7f9f9665493 (patch) | |
tree | 373b34ef1d7f8eabfea9cac896b9dfe2b58a9879 | |
parent | 81ccce55b8025295556c35e83be8657c6f4659ab (diff) | |
download | FreeBSD-src-b5c0015ac9dfb47f49151ad199edb7f9f9665493.zip FreeBSD-src-b5c0015ac9dfb47f49151ad199edb7f9f9665493.tar.gz |
Consolidate MIN/MAX macros into one place (param.h).
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
-rw-r--r-- | sys/alpha/alpha/busdma_machdep.c | 2 | ||||
-rw-r--r-- | sys/amd64/amd64/busdma_machdep.c | 2 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_cd.c | 4 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_pass.c | 4 | ||||
-rw-r--r-- | sys/cam/scsi/scsi_targ_bh.c | 2 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stream.c | 3 | ||||
-rw-r--r-- | sys/contrib/dev/oltr/if_oltr.c | 1 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/ip_proxy.c | 4 | ||||
-rw-r--r-- | sys/dev/advansys/advlib.c | 2 | ||||
-rw-r--r-- | sys/dev/advansys/adwcam.c | 2 | ||||
-rw-r--r-- | sys/dev/aha/aha.c | 4 | ||||
-rw-r--r-- | sys/dev/ahb/ahb.c | 2 | ||||
-rw-r--r-- | sys/dev/buslogic/bt.c | 4 | ||||
-rw-r--r-- | sys/dev/sound/pci/cs4281.c | 3 | ||||
-rw-r--r-- | sys/dev/sym/sym_hipd.c | 7 | ||||
-rw-r--r-- | sys/i386/i386/busdma_machdep.c | 2 | ||||
-rw-r--r-- | sys/i386/isa/gpib.c | 2 | ||||
-rw-r--r-- | sys/i386/isa/gsc.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/busdma_machdep.c | 2 | ||||
-rw-r--r-- | sys/kern/uipc_syscalls.c | 3 | ||||
-rw-r--r-- | sys/net/zlib.c | 2 | ||||
-rw-r--r-- | sys/netinet6/nd6.c | 1 | ||||
-rw-r--r-- | sys/pccard/pccard.c | 2 | ||||
-rw-r--r-- | sys/sys/param.h | 2 |
24 files changed, 0 insertions, 64 deletions
diff --git a/sys/alpha/alpha/busdma_machdep.c b/sys/alpha/alpha/busdma_machdep.c index 3fcbc30..28240ae 100644 --- a/sys/alpha/alpha/busdma_machdep.c +++ b/sys/alpha/alpha/busdma_machdep.c @@ -45,8 +45,6 @@ #include <machine/sgmap.h> #include <machine/md_var.h> -#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 c55469f..21e6025 100644 --- a/sys/amd64/amd64/busdma_machdep.c +++ b/sys/amd64/amd64/busdma_machdep.c @@ -44,8 +44,6 @@ #include <machine/bus.h> #include <machine/md_var.h> -#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 a187c79..ebfe241 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<y) ? x : y) -#endif - #define CD_CDEV_MAJOR 15 static d_open_t cdopen; diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c index d22e621..13580a0 100644 --- a/sys/cam/scsi/scsi_pass.c +++ b/sys/cam/scsi/scsi_pass.c @@ -76,10 +76,6 @@ struct pass_softc { dev_t dev; }; -#ifndef MIN -#define MIN(x,y) ((x<y) ? x : y) -#endif - #define PASS_CDEV_MAJOR 31 static d_open_t passopen; diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c index d01595e..60e68dd 100644 --- a/sys/cam/scsi/scsi_targ_bh.c +++ b/sys/cam/scsi/scsi_targ_bh.c @@ -69,8 +69,6 @@ typedef enum { #define MAX_IMMEDIATE 16 #define MAX_BUF_SIZE 256 /* Max inquiry/sense/mode page transfer */ -#define MIN(a, b) ((a > 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 6742009..ce2b68a 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 ea4dcc3..453fe75 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 332835d..d612adf 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 7d3ec52..d8a35ab 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 91d2c7d..5007413 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 b4dc58b..4ba7cea 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 740d626..ec5d138 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 7bb3010..b7bc725 100644 --- a/sys/dev/buslogic/bt.c +++ b/sys/dev/buslogic/bt.c @@ -72,10 +72,6 @@ #include <dev/buslogic/btreg.h> -#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 e34a162..6018ec2 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 689ce89..fc52a6b 100644 --- a/sys/dev/sym/sym_hipd.c +++ b/sys/dev/sym/sym_hipd.c @@ -398,13 +398,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. */ #define DEBUG_ALLOC (0x0001) diff --git a/sys/i386/i386/busdma_machdep.c b/sys/i386/i386/busdma_machdep.c index c55469f..21e6025 100644 --- a/sys/i386/i386/busdma_machdep.c +++ b/sys/i386/i386/busdma_machdep.c @@ -44,8 +44,6 @@ #include <machine/bus.h> #include <machine/md_var.h> -#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 184c506..4b7b3cb 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 f8328cf..5a94838 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 4bf52d5..e10f084 100644 --- a/sys/ia64/ia64/busdma_machdep.c +++ b/sys/ia64/ia64/busdma_machdep.c @@ -42,8 +42,6 @@ #include <machine/bus.h> #include <machine/md_var.h> -#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 8fd69e7..145e138 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 8797405..9052c1f 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 df3fdb9..3e1fccf 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 bf426fb..17e8e9b 100644 --- a/sys/pccard/pccard.c +++ b/sys/pccard/pccard.c @@ -52,8 +52,6 @@ #include <machine/md_var.h> -#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 9b37d19..036e4bb 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 /* |