Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6161
-gerrit
commit efb1d57536657844edaf74b0bbee5e89b1120cdc Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Mon Jun 30 09:40:19 2014 +0300
stdlib: Drop duplicates of min() and max()
Change-Id: Ib2f6fad735e085d237a0d46e0586e123eef6e0e2 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/drivers/ati/ragexl/atyfb.h | 2 -- src/drivers/pc80/tpm.c | 2 -- src/include/spi_flash.h | 2 -- src/include/stdlib.h | 3 +++ src/northbridge/intel/gm45/raminit.c | 2 +- src/northbridge/intel/nehalem/raminit.c | 4 +--- src/southbridge/intel/common/spi.c | 2 -- 7 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/drivers/ati/ragexl/atyfb.h b/src/drivers/ati/ragexl/atyfb.h index 557ead7..94f31fe 100644 --- a/src/drivers/ati/ragexl/atyfb.h +++ b/src/drivers/ati/ragexl/atyfb.h @@ -6,8 +6,6 @@
#define EINVAL -1
-#define max(x,y) (x>=y)?x:y - #if CONFIG_CONSOLE_BTEXT /* * Elements of the hardware specific atyfb_par structure diff --git a/src/drivers/pc80/tpm.c b/src/drivers/pc80/tpm.c index f581ab4..40f1e7b 100644 --- a/src/drivers/pc80/tpm.c +++ b/src/drivers/pc80/tpm.c @@ -50,8 +50,6 @@ TPM_DEBUG("Write reg 0x%x with 0x%x\n", (reg_), (val_)) #define printf(x...) printk(BIOS_ERR, x)
-#define min(a,b) MIN(a,b) -#define max(a,b) MAX(a,b) #define readb(_a) (*(volatile unsigned char *) (_a)) #define writeb(_v, _a) (*(volatile unsigned char *) (_a) = (_v)) #define readl(_a) (*(volatile unsigned long *) (_a)) diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index fe48d3b..8e51471 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -39,8 +39,6 @@ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );})
-#define min(a, b) ((a)<(b)?(a):(b)) - #define CONFIG_ICH_SPI #ifdef CONFIG_ICH_SPI #define CONTROLLER_PAGE_LIMIT 64 diff --git a/src/include/stdlib.h b/src/include/stdlib.h index cb5a6ca7..44d7c01 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -13,6 +13,9 @@ #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b))
+#define min(a,b) MIN((a),(b)) +#define max(a,b) MAX((a),(b)) + #if !defined(__PRE_RAM__) void *memalign(size_t boundary, size_t size); void *malloc(size_t size); diff --git a/src/northbridge/intel/gm45/raminit.c b/src/northbridge/intel/gm45/raminit.c index d607f84..0636d9f 100644 --- a/src/northbridge/intel/gm45/raminit.c +++ b/src/northbridge/intel/gm45/raminit.c @@ -20,6 +20,7 @@ */
#include <stdint.h> +#include <stdlib.h> #include <arch/cpu.h> #include <arch/io.h> #include <device/pci_def.h> @@ -361,7 +362,6 @@ static void collect_ddr3(spdinfo_t *const config) } }
-#define min(a, b) ((a) < (b))?(a):(b) #define ROUNDUP_DIV(val, by) (((val) + (by) - 1) / (by)) #define ROUNDUP_DIV_THIS(val, by) val = ROUNDUP_DIV(val, by) static fsb_clock_t read_fsb_clock(void) diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c index a2960f6..632abc0 100644 --- a/src/northbridge/intel/nehalem/raminit.c +++ b/src/northbridge/intel/nehalem/raminit.c @@ -25,6 +25,7 @@ #endif
#if REAL +#include <stdlib.h> #include <console/console.h> #include <string.h> #include <arch/hlt.h> @@ -571,9 +572,6 @@ static int find_lowest_bit_set32(u32 val) return -1; }
-#define max(a,b) (((a) > (b)) ? (a) : (b)) -#define min(a,b) (((a) < (b)) ? (a) : (b)) - enum { DEVICE_TYPE = 2, MODULE_TYPE = 3, diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c index b323dbb..51586cc 100644 --- a/src/southbridge/intel/common/spi.c +++ b/src/southbridge/intel/common/spi.c @@ -35,8 +35,6 @@
#include <spi-generic.h>
-#define min(a, b) ((a)<(b)?(a):(b)) - #define HSFC_FCYCLE_OFF 1 /* 1-2: FLASH Cycle */ #define HSFC_FCYCLE (0x3 << HSFC_FCYCLE_OFF) #define HSFC_FDBC_OFF 8 /* 8-13: Flash Data Byte Count */