Consolidate MIN/MAX macros into one place (param.h).
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
This commit is contained in:
parent
81ccce55b8
commit
b5c0015ac9
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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[] = {
|
||||
|
@ -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 ));
|
||||
|
||||
|
||||
|
@ -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++) {
|
||||
|
@ -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*);
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
||||
/* ===========================================================================
|
||||
|
@ -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;
|
||||
|
@ -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 *);
|
||||
|
@ -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
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user