aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
authorElyes HAOUAS <ehaouas@noos.fr>2019-12-03 18:22:06 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-12-20 17:46:37 +0000
commitf97c1c9d86ff56ba9d1de4fc7c9499742224d365 (patch)
treefabc883853e92f997d6e31efddd770e649d0ee35 /src/soc/intel/common
parent836b8d2e4509fb041a15df6d1ce3b20e205260bb (diff)
{nb,soc}: Replace min/max() with MIN/MAX()
Use MIN() and MAX() defined in commonlib/helpers.h Change-Id: I02d0a47937bc2d6ab2cd01995a2c6b6db245da15 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37454 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/fast_spi/fast_spi_flash.c5
-rw-r--r--src/soc/intel/common/smbios.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
index 0a4344272e..f887b3c800 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
@@ -14,6 +14,7 @@
*/
#include <device/mmio.h>
+#include <commonlib/helpers.h>
#include <console/console.h>
#include <fast_spi_def.h>
#include <intelblocks/fast_spi.h>
@@ -157,11 +158,11 @@ static int exec_sync_hwseq_xfer(struct fast_spi_flash_ctx *ctx,
static size_t get_xfer_len(const struct spi_flash *flash, uint32_t addr,
size_t len)
{
- size_t xfer_len = min(len, SPIBAR_FDATA_FIFO_SIZE);
+ size_t xfer_len = MIN(len, SPIBAR_FDATA_FIFO_SIZE);
size_t bytes_left = ALIGN_UP(addr, flash->page_size) - addr;
if (bytes_left)
- xfer_len = min(xfer_len, bytes_left);
+ xfer_len = MIN(xfer_len, bytes_left);
return xfer_len;
}
diff --git a/src/soc/intel/common/smbios.c b/src/soc/intel/common/smbios.c
index d315e15f28..e1b71ba1f0 100644
--- a/src/soc/intel/common/smbios.c
+++ b/src/soc/intel/common/smbios.c
@@ -16,6 +16,7 @@
#include <smbios.h>
#include "smbios.h"
#include <string.h>
+#include <commonlib/helpers.h>
#include <console/console.h>
#include <device/dram/ddr3.h>
@@ -63,7 +64,7 @@ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type,
strncpy((char *)dimm->module_part_number,
module_part_num,
- min(sizeof(dimm->module_part_number),
+ MIN(sizeof(dimm->module_part_number),
module_part_number_size));
if (module_serial_num)
memcpy(dimm->serial, module_serial_num,