From 361a935332489c635192b39204c7ec7af1667c8f Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Wed, 18 Dec 2019 21:26:33 +0100 Subject: {drivers,southbridge}: Replace min() with MIN() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is to remove min/max() from . Change-Id: Ica03d9aec8a81f57709abcac655dfb0ebce3f8c6 Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/coreboot/+/37818 Reviewed-by: Kyösti Mälkki Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) --- src/southbridge/intel/common/spi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/southbridge/intel') diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c index cf678176ab..63206d0a83 100644 --- a/src/southbridge/intel/common/spi.c +++ b/src/southbridge/intel/common/spi.c @@ -18,8 +18,8 @@ #define __SIMPLE_DEVICE__ /* This file is derived from the flashrom project. */ + #include -#include #include #include #include @@ -637,9 +637,9 @@ static int spi_ctrlr_xfer(const struct spi_slave *slave, const void *dout, writel_(trans.offset & 0x00FFFFFF, cntlr.addr); if (trans.bytesout) - data_length = min(trans.bytesout, cntlr.databytes); + data_length = MIN(trans.bytesout, cntlr.databytes); else - data_length = min(trans.bytesin, cntlr.databytes); + data_length = MIN(trans.bytesin, cntlr.databytes); /* Program data into FDATA0 to N */ if (trans.bytesout) { @@ -815,7 +815,7 @@ static int ich_hwseq_read(const struct spi_flash *flash, u32 addr, size_t len, writew_(readw_(&cntlr.ich9_spi->hsfs), &cntlr.ich9_spi->hsfs); while (len > 0) { - block_len = min(len, cntlr.databytes); + block_len = MIN(len, cntlr.databytes); if (block_len > (~addr & 0xff)) block_len = (~addr & 0xff) + 1; ich_hwseq_set_addr(addr); @@ -883,7 +883,7 @@ static int ich_hwseq_write(const struct spi_flash *flash, u32 addr, size_t len, writew_(readw_(&cntlr.ich9_spi->hsfs), &cntlr.ich9_spi->hsfs); while (len > 0) { - block_len = min(len, cntlr.databytes); + block_len = MIN(len, cntlr.databytes); if (block_len > (~addr & 0xff)) block_len = (~addr & 0xff) + 1; -- cgit v1.2.3