summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2008-10-30 17:35:30 -0500
committerWolfgang Denk <wd@denx.de>2008-11-02 16:23:46 +0100
commit20d04774f4ef3f6e38974636e0e36ae0f0b5501f (patch)
tree15562cc70bebb87b130ba1ef5218df84f4297c1d
parent298e476c66fd88d0bc4f0371118652d2b5de4e8a (diff)
Consolidate MAX/MIN definitions
There were several, now there is one (two if you count the lower-case versions). Signed-off-by: Andy Fleming <afleming@freescale.com>
-rw-r--r--board/delta/nand.c2
-rw-r--r--board/zylonite/nand.c2
-rw-r--r--common/cmd_bedbug.c4
-rw-r--r--common/cmd_elf.c4
-rw-r--r--cpu/ixp/npe/include/IxEthDB_p.h2
-rw-r--r--include/common.h3
-rw-r--r--include/usbdcore.h8
7 files changed, 3 insertions, 22 deletions
diff --git a/board/delta/nand.c b/board/delta/nand.c
index 14382f5a854..aff7c54fc24 100644
--- a/board/delta/nand.c
+++ b/board/delta/nand.c
@@ -46,8 +46,6 @@
# define DFC_DEBUG3(fmt, args...)
#endif
-#define MIN(x, y) ((x < y) ? x : y)
-
/* These really don't belong here, as they are specific to the NAND Model */
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
diff --git a/board/zylonite/nand.c b/board/zylonite/nand.c
index 895fb2bacdf..899445ee6ba 100644
--- a/board/zylonite/nand.c
+++ b/board/zylonite/nand.c
@@ -46,8 +46,6 @@
# define DFC_DEBUG3(fmt, args...)
#endif
-#define MIN(x, y) ((x < y) ? x : y)
-
/* These really don't belong here, as they are specific to the NAND Model */
static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index 3e597f98207..e6277c94086 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -13,10 +13,6 @@
DECLARE_GLOBAL_DATA_PTR;
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
extern void show_regs __P ((struct pt_regs *));
extern int run_command __P ((const char *, int));
extern char console_buffer[];
diff --git a/common/cmd_elf.c b/common/cmd_elf.c
index 3ebb6d93544..4d8e1d2762d 100644
--- a/common/cmd_elf.c
+++ b/common/cmd_elf.c
@@ -23,10 +23,6 @@
DECLARE_GLOBAL_DATA_PTR;
#endif
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
int valid_elf_image (unsigned long addr);
unsigned long load_elf_image (unsigned long addr);
diff --git a/cpu/ixp/npe/include/IxEthDB_p.h b/cpu/ixp/npe/include/IxEthDB_p.h
index e7c67ae520d..ccec7ea7be2 100644
--- a/cpu/ixp/npe/include/IxEthDB_p.h
+++ b/cpu/ixp/npe/include/IxEthDB_p.h
@@ -193,8 +193,6 @@ extern int overflowEvent;
#define LEFT (-1)
/* macros */
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-
#define IX_ETH_DB_CHECK_PORT_EXISTS(portID) \
{ \
if ((portID) >= IX_ETH_DB_NUMBER_OF_PORTS) \
diff --git a/include/common.h b/include/common.h
index b8a654a8ad0..df64bf0f419 100644
--- a/include/common.h
+++ b/include/common.h
@@ -177,6 +177,9 @@ typedef void (interrupt_handler_t)(void *);
({ typeof (X) __x = (X), __y = (Y); \
(__x > __y) ? __x : __y; })
+#define MIN(x, y) min(x, y)
+#define MAX(x, y) max(x, y)
+
/**
* container_of - cast a member of a structure out to the containing structure
diff --git a/include/usbdcore.h b/include/usbdcore.h
index cb2be72804a..206dbbc864e 100644
--- a/include/usbdcore.h
+++ b/include/usbdcore.h
@@ -126,14 +126,6 @@
})
#endif
-#ifndef MIN
-#define MIN(a,b) ((a) < (b) ? (a) : (b))
-#endif
-#ifndef MAX
-#define MAX(a,b) ((a) > (b) ? (a) : (b))
-#endif
-
-
/*
* Structure member address manipulation macros.
* These are used by client code (code using the urb_link routines), since