stdlib: Drop duplicates of min() and max()
Change-Id: Ib2f6fad735e085d237a0d46e0586e123eef6e0e2 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/6161 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
parent
f41cb4ecd2
commit
931c1dcec0
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
#define EINVAL -1
|
#define EINVAL -1
|
||||||
|
|
||||||
#define max(x,y) (x>=y)?x:y
|
|
||||||
|
|
||||||
#if CONFIG_CONSOLE_BTEXT
|
#if CONFIG_CONSOLE_BTEXT
|
||||||
/*
|
/*
|
||||||
* Elements of the hardware specific atyfb_par structure
|
* Elements of the hardware specific atyfb_par structure
|
||||||
|
|
|
@ -50,8 +50,6 @@
|
||||||
TPM_DEBUG("Write reg 0x%x with 0x%x\n", (reg_), (val_))
|
TPM_DEBUG("Write reg 0x%x with 0x%x\n", (reg_), (val_))
|
||||||
#define printf(x...) printk(BIOS_ERR, x)
|
#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 readb(_a) (*(volatile unsigned char *) (_a))
|
||||||
#define writeb(_v, _a) (*(volatile unsigned char *) (_a) = (_v))
|
#define writeb(_v, _a) (*(volatile unsigned char *) (_a) = (_v))
|
||||||
#define readl(_a) (*(volatile unsigned long *) (_a))
|
#define readl(_a) (*(volatile unsigned long *) (_a))
|
||||||
|
|
|
@ -39,8 +39,6 @@
|
||||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
||||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|
||||||
|
|
||||||
#define min(a, b) ((a)<(b)?(a):(b))
|
|
||||||
|
|
||||||
#define CONFIG_ICH_SPI
|
#define CONFIG_ICH_SPI
|
||||||
#ifdef CONFIG_ICH_SPI
|
#ifdef CONFIG_ICH_SPI
|
||||||
#define CONTROLLER_PAGE_LIMIT 64
|
#define CONTROLLER_PAGE_LIMIT 64
|
||||||
|
|
|
@ -13,6 +13,9 @@
|
||||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
#define MAX(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__)
|
#if !defined(__PRE_RAM__)
|
||||||
void *memalign(size_t boundary, size_t size);
|
void *memalign(size_t boundary, size_t size);
|
||||||
void *malloc(size_t size);
|
void *malloc(size_t size);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <arch/cpu.h>
|
#include <arch/cpu.h>
|
||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
#include <device/pci_def.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(val, by) (((val) + (by) - 1) / (by))
|
||||||
#define ROUNDUP_DIV_THIS(val, by) val = ROUNDUP_DIV(val, by)
|
#define ROUNDUP_DIV_THIS(val, by) val = ROUNDUP_DIV(val, by)
|
||||||
static fsb_clock_t read_fsb_clock(void)
|
static fsb_clock_t read_fsb_clock(void)
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if REAL
|
#if REAL
|
||||||
|
#include <stdlib.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <arch/hlt.h>
|
#include <arch/hlt.h>
|
||||||
|
@ -571,9 +572,6 @@ static int find_lowest_bit_set32(u32 val)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define max(a,b) (((a) > (b)) ? (a) : (b))
|
|
||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
DEVICE_TYPE = 2,
|
DEVICE_TYPE = 2,
|
||||||
MODULE_TYPE = 3,
|
MODULE_TYPE = 3,
|
||||||
|
|
|
@ -35,8 +35,6 @@
|
||||||
|
|
||||||
#include <spi-generic.h>
|
#include <spi-generic.h>
|
||||||
|
|
||||||
#define min(a, b) ((a)<(b)?(a):(b))
|
|
||||||
|
|
||||||
#define HSFC_FCYCLE_OFF 1 /* 1-2: FLASH Cycle */
|
#define HSFC_FCYCLE_OFF 1 /* 1-2: FLASH Cycle */
|
||||||
#define HSFC_FCYCLE (0x3 << HSFC_FCYCLE_OFF)
|
#define HSFC_FCYCLE (0x3 << HSFC_FCYCLE_OFF)
|
||||||
#define HSFC_FDBC_OFF 8 /* 8-13: Flash Data Byte Count */
|
#define HSFC_FDBC_OFF 8 /* 8-13: Flash Data Byte Count */
|
||||||
|
|
Loading…
Reference in New Issue